gpt4 book ai didi

html - css垂直对齐帮助

转载 作者:行者123 更新时间:2023-11-28 19:04:28 24 4
gpt4 key购买 nike

我使用的是严格的文档类型,无法让我的一个 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com