text-decoration: underline vs border-bottom

后端 未结 7 1822
后悔当初
后悔当初 2021-02-13 04:04

What is the difference to use {text-decoration: underline} and {border-bottom: ...}?

which is easy to style and cross browser compatible?

7条回答
  •  难免孤独
    2021-02-13 04:32

    Sorry to say this, but some answers here are misleading. Splitting a line of text does not place the border at the bottom of the entire block, because of the nature of inline blocks. Borders under links are actually more consistent across browsers than text-decoration: underline.

    See: Text-Decoration vs. Border-Bottom

提交回复
热议问题