这是情况,我有这个html:
<div id='main'>
<div id='menu'>
Menu Items Here
</div>
<div id='cont'>
Content Here
<div id='footer'>Some Footer</div>
</div>
</div>
CSS在这里:
html, body {
height: 100%;
width : 100%;
margin: 0;
padding: 0;
}
#main{
overflow : auto;
background-color: yellow;
width : 100%;
min-height : 100%;
}
#menu {
background-color: red;
float : left;
width : 300px;
}
#cont {
margin-left : 300px;
float : right;
background-color: orange;
width : 100px;
min-height : 100%;
height: auto !important; /*min-height hack*/
height: 100%; /*min-height hack*/
}
我基本上想做的是#cont div的最小高度必须为100%(如果我的内容较小),但是如果内容较长则可以扩展。
任何帮助,将不胜感激。
注意:目前,宽度大小只是暂时的。
谢谢!
这可能起作用:
#main{
height : 100%;
}
#cont {
min-height : 100%;
/* Without the hacks */
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句