为什么我的html页面上有不必要的保证金?

时间:2023-02-12 09:08:07

i keep getting unwanted top margin and cant remove it, i tried everything, this is affected one of my other projects as well, could find any solution. please help heres my html:

我一直得到不必要的上边距,不能删除它,我尝试了一切,这也影响了我的其他项目之一,可以找到任何解决方案。请帮助我的html:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Joy The Designert</title>
<link href="style1.css" rel="stylesheet" type="text/css" />
</head>

<body topmargin=0 marginheight=0>
<div id="Wrapper">
<div id="topBanner"><div class="container"><h2>top banner content</h2></div></div>
<div id="nav"><div class="container">Navigation Text<?include ("navigation.php");?></div></div>
<div id="featured"><div class="container"></div></div>
<div id="info"><div class="container">test</div></div>
<div id="support"><div class="container">test</div></div>
<div id="footer"><div class="container">testing footer<?include ("footer.php");?></div></div>
</div>
</body>
</html>

and heres my css content:

并且我的css内容:

   @charset "utf-8";
/* CSS Document */
html {
    margin:!important 0px;
    padding:0px;
}
body {
    margin-top:!important 0px;
    margin-left:0px;
    margin-right:0px;
    margin-botton:0px;
    padding:0px;
    border:none;
    color: #292929;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 81.25%;

}
#wrapper {
    margin:0px;
    Width:1000px;
    height:auto;

}
.container {
    width:900px;
    margin:auto;

}
#topBanner{
    background-image:url(images/scr_gray-bkgd.png);
    background-repeat:repeat-x;
    height:44px;
    width:100%;
}
#nav{
    height:72px;
    width:100%;
    padding
    color:#666666;
    background-color: #F5F5F5;
    border-bottom: 1px solid #FFFFFF;
    box-shadow: 0 -5px 5px #5A595D;
    color: #666666;
    font-weight: bold;
    height: 72px;
}
#featured {
    min-height:420px;
    width:100%;
    background: url(none) no-repeat scroll center top #ECECEC;
    border-bottom: 1px solid #FFFFFF;
}

#info{

    background: url(images/gradient-bg.png);
    background-repeat:repeat-x;
    height: 256px;
    width: 100%;

}
#support{
    background-color: #F5F5F5;
    border-top: 1px solid #FFFFFF;
    box-shadow: 0 5px 5px #5A595D;
    height:55px;
    width:100%;
    }
#footer{
    width:100%;
    height:150px;
    background-image:url(images/scr_gray-bkgd.png);
    background-repeat:repeat;

}

1 个解决方案

#1


5  

#topBanner h2{
    margin:0px;
}

This should solve it ;)

这应该解决它;)

#1


5  

#topBanner h2{
    margin:0px;
}

This should solve it ;)

这应该解决它;)