#Container { width: 500px; height: 600px; } #TheElement { width: 500px; height: 100px; background-color: #000000; }
我如何将#TheElement锁定到#Container的最底层,无论容器内的其他内容如何,没有一堆边缘欺骗?
解决方法@H_301_8@
你可以使用
relative absolute positioning:
#Container {
width: 500px;
height: 600px;
position: relative
}
#TheElement {
width: 500px;
height: 100px;
background-color: #000000;
position: absolute;
bottom: 0;
left: 0;
}
#Container { width: 500px; height: 600px; position: relative } #TheElement { width: 500px; height: 100px; background-color: #000000; position: absolute; bottom: 0; left: 0; }