Css 即使没有元素比容器宽,也会显示水平滚动条?
这是我的CSS。我已经计算了所有元素的宽度,但似乎找不到罪魁祸首。 我确实弄乱了代码,当header nav设置为850px或更低时,滚动条消失了。请帮忙Css 即使没有元素比容器宽,也会显示水平滚动条?,css,scrollbar,Css,Scrollbar,这是我的CSS。我已经计算了所有元素的宽度,但似乎找不到罪魁祸首。 我确实弄乱了代码,当header nav设置为850px或更低时,滚动条消失了。请帮忙 html, body { margin: 0px; padding: 0px; background-color: #FFFFFF; font-family: "Trebuchet MS"; font-size: 10pt; color: #222
html, body {
margin: 0px;
padding: 0px;
background-color: #FFFFFF;
font-family: "Trebuchet MS";
font-size: 10pt;
color: #222222;
}
#container {
position: relative;
margin: 0px auto;
width: 1200px;
padding: 0px;
background: url(images/container-bg.png) repeat-y;
}
#header-nav {
width: 1200px;
height: 150px;
background: url(images/header-bg.png) no-repeat;
}
#menu{
position: relative;
top: 95px;
left: 390px;
list-style:none;
z-index:5;
padding: 0px;
margin: 0px;
}
#nav {
position: absolute;
left: 101px;
width: 230px;
padding: 10px;
}
#main {
position: relative;
left: 351px;
width: 720px;
min-height: 600px;
padding: 15px;
}
#footer {
position: relative;
left: 101px;
bottom: 0px;
width: 980px;
height: 99px;
padding: 10px;
background: url(images/footer-border.png) no-repeat;
background-color: #FFFFFF;
}
你能提供一个提琴让我们帮忙吗?只是添加了一个提琴。当浏览器大于1200像素时,提琴中没有滚动条。请看一看。如果它还在,你能解释一下这个问题吗?编辑:-ctrl+shift+上箭头切换侧边栏。这很奇怪。我也没看到小提琴上有滚动条。但是,正如您看到的,如果您遵循第二个链接,则会出现一个滚动条。网站和提琴的CSS是完全一样的,即使我删除了所有内容,滚动条也会保持不变。哦,我刚刚弄明白了。是导航栏把事情搞砸了。小提琴确实有用。也谢谢你!