How to vertically align 2 different sizes of text?

后端 未结 8 640
终归单人心
终归单人心 2020-12-02 13:48

I know to vertically align text to the middle of a block, you set the line-height to the same height of the block.

However, if I have a sentence with a word in the m

8条回答
  •  爱一瞬间的悲伤
    2020-12-02 14:26

    You can use percentage sizes to reapply the parent's line-height

    .big {
      font-size: 200%;
      line-height: 25%;
      display: inline-block;
      vertical-align: middle;
    }
    Utque aegrum corpus etiam levibus solet offensis 

提交回复
热议问题