我似乎无法使用 twitter bootstrap 框架将 div 绝对定位在其父项中。我有一系列遵循如下方案的行
<div id='wrapper'>
<div class='row-fluid'>
<div class='span2'>some content here</div>
<div class='span9'>other content to the side of the first div</div>
<div class='timestamp'>123456 this should align to the bottom right of wrapper</div>
</div>
</div>
CSS
.timestamp{
position:absolute;
bottom:0px;
right:0px;
}
但是时间戳 div 始终将自己定位到整个 dom 文档主体的绝对位置,忽略任何中间 div。知道是什么原因造成的吗?
最佳答案
你的CSS应该包括
#wrapper {
position: relative;
}
默认定位是静态的。
查看这篇文章: http://css-tricks.com/absolute-positioning-inside-relative-positioning/
关于css - 我如何在 Twitter Bootstrap css 框架中正确定位绝对 div,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9898814/