css如何使这个div在另一个div的底部
这个问题在这里已经有了答案:
你可以使用position: absolute; bottom: 0px; position: absolute; bottom: 0px; 和position: relative; 在它的容器上。
演示
.bottom {
position: absolute;
bottom: 0px;
}
然而,绝对定位的div不会扩大其容器的高度,并且如果高度太小,它将与其他内容重叠。
使用相对定位将x [unit]从原始位置移开。 设置
position: relative;
bottom: 0;
将从底部向上移动0 [单位]。
在这里演示
你只需要添加2个规则。
.slNewClass {
position: absolute;
bottom:0 ;
}
.mainTable {
position: relative;
}
DEMO
请执行下列操作:
.slNewClass div设置为position: absolute; & bottom: 0px; .mainTable div box-sizing: to border-box then add add padding bottom like this padding-bottom: 130px; 注意:底部填充应该与底部div高度+呼吸空间的一些额外像素相同。
链接地址: http://www.djcxy.com/p/75781.html