请参阅附件图片,我想在html中设计,相当成功。但是当我在不同的分辨率下测试它时,红色的盒子在这里和那里移动。我在100%的宽度和高度100%CSS问题重叠图片
<style type="text/css">
#green-box { width: 75%; background: green; float: left; position: relative; height: 100%; overflow: visible; position: relative; }
#blue-box { width: 25%; background: blue; float: left; height: 100%; }
#red-box {
position: relative;
top: 50px;
left:450px;
width: 357px;
background: red;
height: 207px;
margin:0 auto;
}
#green-box-content
{
margin:0 auto;
width:1600px;
height:800px;
}
</style>
<div id="container">
<div id="green-box">
<div id="green-box-content">
<p>Here is some text!</p>
<div id="red-box"></div>
</div>
</div>
<div id="blue-box">
</div>
<div style="clear: both"></div>
</div>
Best,Thanks.Thats我缺少的东西 – user2451541
但是,如果我将蓝色和绿色框的高度延伸到100%,红色框消失 – user2451541
我需要知道其周围的代码的其余部分以帮助,因为设置高度到100%取决于声明高度的父元素。了解您正在查看的浏览器也是有帮助的。 –