css - text-bottom 是什么意思?

标签 css

有没有人告诉我如何区分 CSS 中“veritical-align”的“text-bottom”和“bottom”。非常感谢。

最佳答案

如果包含显式的 heightline-height 会更明显。 text-bottom 将匹配文本的底部,而 bottom 将匹配元素的底部。

div {
   display: inline-block;
   font-family: "Arial";
   background-color: blue;
   height: 100px;
   line-height: 80px;
}
    		
#left .px100 {
   font-size: 100px;
}
    		
#left .px50 {
   font-size: 50px;
   vertical-align: text-bottom;
}
    		
#right .px100 {
   font-size: 100px;
}
    		
#right .px50 {
   font-size: 50px;
   vertical-align: bottom;
}
<div id="left">
   x
   <span class="px100">x<span>
   <span class="px50">x<span>
</div>
<div id="right">
   x
   <span class="px100">x<span>
   <span class="px50">x<span>
</div>

关于css - text-bottom 是什么意思?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50256412/

相关文章:

javascript - 相对于另一个元素放置元素

css - 额外的、未使用的 CSS 定义会降低浏览器的速度吗?

javascript - 页面未滚动到 salesforce 闪电中的顶部

css - 具有多种背景选择的响应图像

jquery - 将页面滚动到滚动 jquery 上的 div

javascript 函数在 cakephp 2 中无法正常工作

html - 向左浮动 div,向右浮动另一个 div

javascript - Bootstrap float 导航栏和 anchor 对齐

jquery - 定义 "custom"HTML 标签是不好的做法吗

html - 如何使用 Bootstrap 修复 fa fa 电话图标部分