css vertical-align是相对于什么的位置?

baseline
Aligns the baseline of the element with the baseline of its parent. The baseline of some replaced elements, like <textarea>, is not specified by the HTML specification, meaning that their behavior with this keyword may vary between browsers.
sub
Aligns the baseline of the element with the subscript-baseline of its parent.
super
Aligns the baseline of the element with the superscript-baseline of its parent.

这三个属性分别是什么效果?
阅读 2.1k
1 个回答

baseline是基线对齐,基于文本的下边沿对齐。
sub和super的话,CO₂和㎡你肯定不陌生,两种对其方式就分别对齐于两者的2。

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题