CSS宽度100%没有工作 [英] CSS width 100% no working
问题描述
我有一个导航栏,设置为宽度100%。它显示完美,但问题是,当它放大时,右侧留下一个空间。您可以在 http://jsfiddle.net/ShNtf/ 中查看工作示例。
以下是我的CSS代码: -
.nav-container {
width:100%;
颜色:#fff;
背景:#000;
}
.nav-contained {
min-width:350px;
}
}
body {
padding:0;
保证金:0;
问题: 当水平滚动条可见时,背景颜色不会填充浏览器宽度。 解决方案: 通过将 I have a navigation bar that is set to width 100%. It displays perfectly but the problem is that when it is zoomed, a space is left in the right side. You can see the working example at http://jsfiddle.net/ShNtf/
The follwing is my CSS code:-
Problem: When a horizontal scroll-bar is visible, background color doesn't fill browser width. Solution: I had success by moving the 这篇关于CSS宽度100%没有工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
background-color
定义移至 .nav-container
至 .nav-contained
。
.nav-container {
width:100%;
}
.nav-contained {
min-width:350px;
背景:#000;
颜色:#fff;
}
.nav-container{
width:100%;
color:#fff;
background:#000;
}
.nav-contained{
min-width:350px;
}
}
body{
padding:0;
margin:0;
}
background-color
definition to from .nav-container
to .nav-contained
..nav-container {
width:100%;
}
.nav-contained {
min-width:350px;
background:#000;
color:#fff;
}