CSS 100%宽度破碎

时间:2012-02-23 15:51:56

标签: html5 css3

我正在开发PHP / HTML5 / CSS3页面并遇到了一个问题。我以某种方式完成了这项工作,然后添加了一些代码,进行了一些更改,并打破了它。

概念是页面的多个部分宽度为100%,但具有预定义的高度。然而,现在宽度:100%它运行全宽,少于15-20 px(~1%)。它具有CSS样式的属性,例如:

html {
width: 100%;
}

body{
background-color:#fbf9ec;
font-family:"Times New Roman", Times, serif;
width:100%;
}


#upperContainer{
height: 100px;
width: 875px;
margin: 0 auto;
position: relative;
}

#topLogo{
width: 250px;
height:75px;
background-image:url(../images/logo.png)
}

#nav{
background-image:url(../images/nav-bg.png);
height: 32px;
width: 100%;
margin-left:-10px;
background-repeat:repeat-x;
}

#featuredContent{
height: 336px;
width: 100%;
margin-left:-12px;
background-image:url(../images/featured-bg.png);
}

#sliderA{
background: #3a7c38;
height: 326px;
width: 873px;
margin: 0 auto;
padding: 10px 0 0 0;
border:1px #353f35;
border-right-style:solid;
border-left-style:solid;
position: relative;
}

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

您设置了负左边距。删除它们,看它是否排成一行。

#nav{
    margin-left:-10px;
}

#featuredContent{
    margin-left:-12px;
}
相关问题