我在 bootstrap col 中有一个带有 bg 图像的 div,现在我的计划是让 div 中的文本贴在底部我尝试过垂直对齐,但似乎不起作用
我的 html:
<div class="has-image col-md-6 nopadding">
<div style="background-image: url('img/st-jansvliet.jpg');">
<div class="stick-to-bottom">Sint Jansvliet- Antwerpen</div>
</div>
</div>
我的CSS:
.stick-to-bottom{
vertical-align: bottom;
}
带有 bg 图像的 div 的高度与我用 jquery 设置的屏幕尺寸相对应
最佳答案
我已经用这样的绝对位置修复了它:
position: absolute;
bottom: 0;
left: 5%;
right: 0;
top: 95%;
关于html - bootstrap css 使带有 bg 图像的 div 中的文本粘在底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35915033/