我的网页设计项目的横幅并不在正确的位置

问题描述:

我的横幅广告是直接位于导航栏的下方,但截至目前,它之间有空间。我试图使用顶部的CSS,它不会移动。我的网页设计项目的横幅并不在正确的位置

为旗帜的CSS是:

/*Index CSS*/ 
 

 
* { 
 
    margin:0px; padding: 0px; 
 
    } 
 

 

 
body { 
 
    position: absolute; 
 
    width: 1250px; 
 
    height: auto; 
 
    margin-left: auto; 
 
    margin-right: auto; 
 

 
} 
 

 
#wrapper { 
 
    background-color: rgb(161, 193, 217); 
 
    position: absolute; 
 
    width: 1250px; 
 
    height: auto; 
 
    margin-left: 5px; 
 
    margin-right: 5px; 
 
} 
 

 

 
#welcome { 
 
    background: url(../Resources/Header/CUiZMwBXAAAQy1M.jpg); 
 
    width: 1250px; 
 
    height: 480px; 
 
} 
 

 

 
#WelcomeTo { 
 
    
 
    color: white; 
 
    font-size: 55px; 
 
    text-align: center; 
 
    font-family: Bebas; 
 
    
 
    margin-top: 100px; 
 
} 
 

 
#LittleChef { 
 
    color: white; 
 
    font-size: 60px; 
 
    text-align: center; 
 
    
 
    font-family: Candy Shop Personal Use; 
 
}
<div id="welcome" name="banner"> 
 
      
 
      <div id="WelcomeTo" name="WelcomeTo"> 
 
      <h1>WELCOME<br>TO</h1> 
 
      </div> 
 
      
 
      <div id="LittleChef" name="LittleChef"> 
 
      <h1>Little Chef</h1> 
 
      </div> 
 
      
 
     </div>

我有这个问题很长一段时间。以下是截至目前为止的screenshot

+0

无论是代码也不是问题是有关PHP的填充。 –

这是因为您的h1元素的余量。

的解决方案是一套h1的边距为0

或者你可以设置包装