#Container {
width: 500px;
height: 600px;
}
#TheElement {
width: 500px;
height: 100px;
background-color: #000000;
}
如何将#TheElement锁定到#Container的最底部,无论容器内的其他内容如何,没有一堆边缘欺骗?
答案 0 :(得分:63)
您可以使用relative absolute positioning:
#Container {
width: 500px;
height: 600px;
position: relative
}
#TheElement {
width: 500px;
height: 100px;
background-color: #000000;
position: absolute;
bottom: 0;
left: 0;
}