html - 将文本放在 div 的底部

标签 html css

我有 4 个相邻的 DIV,它们都位于屏幕中央。我在每个 div 中有 2 个单词,但我不希望它们位于顶部,我希望它们出现在 div 的右下角。我该怎么做?

最佳答案

span 或类似的方式包裹文本,并使用以下 CSS:

.your-div {
    position: relative;
}

.your-div span {
    position: absolute;
    bottom: 0;
    right: 0;
}

关于html - 将文本放在 div 的底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5288336/

相关文章:

javascript - 表单自动提交

javascript - 使整个 DIV 可点击(下拉列表除外)

jquery - header、container 和 footer 需要包含整个布局而不使用固定位置

html - 使用纯CSS在箭头周围画圈

javascript - 重叠的 HTML 元素

html - 有没有办法让一个 <td> 显示在它自己的行上?

image - IE9 - 11 SVG 背景模糊

html - 如何居中 "center of div"而不是 div 的 "starting point"

html - 底部 div 重叠

html - 如何消除 Bootstrap 导航栏和下拉项之间的差距