What is the difference to use {text-decoration: underline}
and {border-bottom: ...}
?
which is easy to style and cross browser compatible?
when we should use border-bottom
over text-decoration: underline
?
Would it be good to use border-bottom
always in place of text-decoration: underline
?
underline: It is used to display a line below or under a text.
The text-decoration property adds an underline, overline, line-through, or a combination of lines to selected text.
The text-decoration-line property is used to add a decoration line to text. Tip: You can combine more than one value, like overline and underline to display lines both over and under a text.
The property text-decoration-line is used to underline the text. This property has three values that are overline, underline, or line-through. So, the value underline is used to underline the text in CSS.
border-bottom
puts a line at the bottom of the element box. text-decoration:underline
renders the text underlined. The exact difference depends on the HTML and text layout engines in use, but in general if you want text underlined, then underline it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With