在我将 float:left
属性设置为其子 div 后,
min-height
不适用于父 Div。
你能帮帮我吗。
<style type="text/css">
*{ margin: 0 auto; padding: 0; }
#wrapperd{
width : 500px;
border : 1px solid red;
min-height:200px;
}
#test {
border:2px solid blue;
width:600px;
float:left;
height:500px;
}
</style>
HTML代码
<div id = "wrapperd"> <!-- Parent Div -->
<div id = "test"> </div> <!-- Child Div -->
</div>
演示链接:- http://jsfiddle.net/rushijogle/cFX68/2/
提前致谢:)
最佳答案
经典的清除修复问题:
1)将父级设置为溢出:隐藏;如上所述。唯一的问题是是否有任何内容会溢出父框。
2) 我喜欢使用的另一个明确的修复技巧是:http://nicolasgallagher.com/micro-clearfix-hack/我认为这与 Cherry 的评论相似......
关于html - 最小高度不适用于 Parent Div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15506123/