调整页面最外边距的问题

时间:2011-02-06 17:58:30

标签: css

外部div和Body的外边缘似乎有大约4px的边距。在黄色分区和蓝色分区之间。这是在最外层div和Body Div的顶部和左侧之间。

outer-div(global-wrap)的宽度= 100%

这是CSS:

body
{
    /*background: url("/images/damask-back.jpg") repeat scroll 0 0 #423624;*/
    background: url("/images/blueback1.jpg") repeat-x scroll 0 0 transparent;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 62.5%;
    /*height: 50%;*/
}
#global-wrap {
    width: 100%;
    /*height: 925px;*/
    /*position: relative;*/
    /*margin: 10px auto;*/
}
#top-wrap {
    height: 112px;    
    background-color: Yellow; 
}
#head-logo {
    /*background: url("/images/logo2.png") no-repeat scroll 0 0 transparent;*/
    background-color: Green;
    height: 112px;
    width: 176px;
    margin: 0px 0 0 45px;
    position: absolute;
    z-index: 100;
}

这是HTML:

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<link href="~/Styles/StyleSheet1.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div id="global-wrap">
    <div id="top-wrap">
        <div id="head-logo"><a href="/"></a></div>          
    </div>
    <div id="global-inner" >  
    </div>
</div>
</form>
</body>
</html>

1 个答案:

答案 0 :(得分:0)

  
* { margin:0; padding:0 }
body
{
    /*background: url("/images/damask-back.jpg") repeat scroll 0 0 #423624;*/
    background: url("/images/blueback1.jpg") repeat-x scroll 0 0 transparent;
    font-family: Arial,Helvetica,sans-serif;
    font-size: 62.5%;
    /*height: 50%;*/
}
/* .... */
在CSS的顶部

应该可以做到这一点;