html - bootstrap css 使带有 bg 图像的 div 中的文本粘在底部

标签 html css twitter-bootstrap

我在 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/

相关文章:

javascript - 以最小的努力使 Twitter Bootstrap v2.3.2 HTML 模板与 Bootstrap 3 兼容

html - 使某些表单字段与标签内联

html - 如何使用css制作一排在浏览器缩小时不换行的框?

html - 无法居中网站

javascript - 多个提交按钮 - html express node js

jquery - 使用 CSS 定位文本但不定位同级元素

javascript - Facebook 图片查看器滚动问题

jquery - 检查号码然后更换

html - 在另一个页面中偏移 anchor

css - 这个 CSS 选择器是做什么的