Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is element <u> considered outdated according to VS2008?

Why do I get the following message in Visual Studio when I use the <u> element?

"Element 'u' is considered outdated. A newer construct is recommended"

Has it aged?

like image 203
Agnel Kurian Avatar asked Jul 03 '09 11:07

Agnel Kurian


People also ask

Why was the U tag removed?

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 is the U tag for?

Definition and Usage The <u> tag represents some text that is unarticulated and styled differently from normal text, such as misspelled words or proper names in Chinese text. The content inside is typically displayed with an underline. You can change this with CSS (see example below).


2 Answers

The underline tag has been deprecated as of HTML4. The W3C reference can be found here. The reason is that visual styling does not belong in tags, but should be moved to style-sheets.

You can use the text-decoration: underline style instead:

<span style="text-decoration: underline">some underlined text</span>

To remove underline, use text-decoration:none to disable underlining.

like image 127
Joeri Sebrechts Avatar answered Sep 21 '22 12:09

Joeri Sebrechts


It's because the W3C decided to deprecated it.

It's because all layout and design should be done using CSS. In HTML ideally only structure should exist.

<u> only adds a specific font decoration to the text, but no structural information.

like image 36
Daniel Rikowski Avatar answered Sep 22 '22 12:09

Daniel Rikowski