Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is use of <u>underline</u> deprecated and non validated? [closed]

Tags:

html

xhtml

w3c

Is use of underline deprecated and non validated?

like image 633
Jitendra Vyas Avatar asked Jan 21 '10 16:01

Jitendra Vyas


People also ask

Is the U tag deprecated?

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.

What does u </ u mean in HTML?

<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.

What is the tag used to add underline to text deprecated?

The <u> Tag (Deprecated) This tag tells the browser to underline the text contained between the <u> and the corresponding </u> tag.

What is the closing tag for underline?

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.


2 Answers

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.

like image 157
Jonny Haynes Avatar answered Sep 18 '22 19:09

Jonny Haynes


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> 
like image 37
Sampson Avatar answered Sep 21 '22 19:09

Sampson