<u>

The HTML <u> element underlines text, used to highlight or distinguish it. However, CSS is now commonly used for this styling purpose instead.

u tag

The <u> tag in HTML is used to underline text. Initially designed for stylistic purposes, it is now mainly used for specific semantic meanings, such as indicating proper names, foreign words, or spelling errors. CSS is generally preferred for underlining text decoratively.

Syntax

index.html
<u>underlined text</u>

u Demo

Today's Special: Salmon
Today's Special: Salmon
index.html
<u>Today's Special</u>: Salmon<br />
<span style="text-decoration:underline;">Today's Special</span>: Salmon
<!-- The <span> tag is used here for underlining as a decorative effect controlled with CSS. -->
Avoid using the <u> element where text might be confused with a hyperlink.

See Also

  • Consider using <span>, <i>, <em>, or <cite> when applicable.
  • Use the CSS text-decoration property to achieve the previous styling effect of the <u> element.

Conclusion

The <u> tag in HTML underlines text but is generally not recommended for styling, as CSS offers more control over text decoration. Instead, it is used for semantic purposes, such as marking proper names, foreign terms, or misspelled words. To prevent confusion, avoid using <u> for elements that might be mistaken for links.