有父块:HTML - 烦恼与div的
#content
{
position: relative;
width: 92%;
margin: 0 auto;
height: 100%;
min-height: 500px;
border: 1px solid red;
}
我需要2块吧:
#news
{
position: relative;
float: left;
min-height: 400px;
width: 290px;
height: 100%;
}
#text
{
position: relative;
float: left;
margin-left: 20px;
min-height: 400px;
width: 625px;
height: 100%;
}
<div id="content">
<div id="news">
...
</div>
<div id="text">
...
</div>
</div>
但第二个文本块不在一个符合新闻。而且,在调整新闻和文本块的大小后,内容块也应调整大小,但它不会......为什么?
overflow:hidden;正是这一点,我需要的高度和浮动div,但你可以再看看那个页面,现在内容块已经改变了它的位置,为什么? – Ockonal 2009-12-04 13:52:29
看起来像#head_float_layer div的相对位置正在导致这个问题,因为#内容已被正确定位。尝试将#head_float_layer更改为: #head_float_layer {background_ image:url(../ images/head_layer.png); height:336px; margin:0; 填充:0; position:absolute; right:100px; top:0; width:448px; z-index:9999; } 如果您不希望图像重叠得太多,您需要添加尽可能多的边距以满足您的需求# – 2009-12-04 14:15:12
非常感谢!我并不认为这是由于head_float_layer造成的。我已经解决了我的问题! – Ockonal 2009-12-04 14:24:21