Vertically align floating divs

前端 未结 5 2004
故里飘歌
故里飘歌 2020-12-25 11:08

I am trying to float two divs with different font-sizes. I can\'t find a way to align the text on the same baseline. Here is what I have been trying:

5条回答
  •  青春惊慌失措
    2020-12-25 11:32

    If you put the right floated div before the left floated div in the HTML and they'll line up vertically.

    Alternatively, you can float both divs left - that's perfectly valid - and how most CSS designs are coded.

提交回复
热议问题