How to vertically align 2 different sizes of text?

后端 未结 8 662
终归单人心
终归单人心 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:39

    This works

    header > span {
        margin: 0px 12px 0px 12px;
        vertical-align:middle;
    }
    .responsive-title{
        font-size: 12vmin;
        line-height: 1em;
    }
    .responsive-subtitle{
        font-size: 6vmin;
        line-height: 2em;
    }
    Foo Bar

提交回复
热议问题