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