我使用的是严格的文档类型,无法让我的一个 div 与底部对齐。我想在父容器上指定 100% 高度,然后将内部容器推到父容器的地板上。这是如何使用严格的文档类型完成的?
这是父级:-- 按预期工作。在 100% 高度
#content_left {
vertical-align:top;
padding:0;
margin:0;
min-width:195px;
color:#fff;
height:100%;
}
这是内部 div:不起作用
.sidebarmenu {
position:relative;
bottom:0;
height:100%;
border:1px solid red;
}
最佳答案
我认为您需要使用绝对定位并指定 bottom: 0
:
#content {
position: absolute;
bottom: 0;
}
关于html - css垂直对齐帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4212933/