我有一个奇怪的情况下面的代码,我的body宽度设置为980px我的标题和内容宽度设置为100%所以他们应该伸展整个屏幕,但在Firefox中他们没有几个像素和铬,他们只是到达中途,奇怪的是页面的主体覆盖整个屏幕我检查设置background:black为body与整个页面变成黑色,然后标题和内容如何功亏一篑用width:100%.但这个代码工作正常上cssdesk cssdesk那么,什么是错我的浏览器.我的屏幕分辨率是1366x768.
body {
width: 980px;
margin: 0;
background-color: #000;
}
.header {
color: #fff;
margin: 0;
width: 100%;
height: 60px;
background-color: #F23F21;
}
#container {
width: 100%;
}
.one {
height: 200px;
float: left;
border: 1px solid red;
width: 25%;
box-sizing: border-box;
}
.two {
height: 200px;
display: inline-block;
border: 1px solid blue;
box-sizing: border-box;
width: 50%;
}
.three {
height: 200px;
float: right;
border: 1px solid green;
box-sizing: border-box;
width: 25%;
}Run Code Online (Sandbox Code Playgroud)
<body>
<div class="header">This is header</div>
<div id="container">
<div class="one">
</div>
<div class="two">
</div>
<div class="three">
</div>
</div>
</body>Run Code Online (Sandbox Code Playgroud)