Is use of underline deprecated and non validated?
The <u> element was originally used to identify text that should be underlined. The element was deprecated in HTML 4.01, but in HTML5 it was redefined to represent text that should be displayed in a way that is an unarticulated but stylistically distinct from the surrounding text.
<u>: The Unarticulated Annotation (Underline) element. The <u> HTML element represents a span of inline text which should be rendered in a way that indicates that it has a non-textual annotation. This is rendered by default as a simple solid underline, but may be altered using CSS.
The <u> Tag (Deprecated) This tag tells the browser to underline the text contained between the <u> and the corresponding </u> tag.
3. What are the opening and closing tags for underlining text? The opening tag for underlining text is <U> and the closing tag for underlining is </U>. Whatever text you put in between these two tags will be underlined on your Web page.
It's deprecated in HTML 4 http://www.w3.org/TR/REC-html40/present/graphics.html#edef-U so won't validate.
Use styles instead. Maybe a <span>
tag. Although, if you want the thing you're trying to add an underline to, to be emphasized without styles enabled. Use an <em>
tag and use CSS to give it an underline.
Yes, it's deprecated. Use styles instead. Note also that underlined text can be confusing, as it resembles the default styling of links, and might frustrate some users.
If you wanted, you could even repurpose another HTML element, like em
:
CSS:
em { font-style: normal; /* Removes italics */ text-decoration: underline; /* Makes underline */ }
HTML:
<p>I like to <em>underline</em> words.</p>
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