HTML Tags

HTML <u> Tag

The <u> tag in HTML is used to underline text.
Originally, <u> was purely stylistic, but in modern HTML5, it can also indicate non-emphatic text that should be stylistically different, such as proper names, misspelled words, or terms needing attention.
It is an inline element.

Syntax

html

<u>Underlined text here</u>

Attributes

AttributeDescription
classAssigns one or more class names for styling.
idAssigns a unique identifier to the element.
styleAdds inline CSS styles to customize appearance.
titleProvides additional information as a tooltip.

Example

html

<!DOCTYPE html>
<html>
<head>
  <title>U Tag Example</title>
  <style>
    .underline {
      text-decoration: underline;
      color: #1a237e;
    }
  </style>
</head>
<body>
  <h1>HTML <u> Tag Example</h1>
  <p>
    This is an <u class="underline" id="important-word" title="Underlined Text">underlined word</u> in a paragraph.
  </p>
  <p>
    Example: Please read the <u>Terms and Conditions</u> carefully.
  </p>
</body>
</html>

Output

Browser Output

html

Use our TryIt Editor to see the output.

Browser Support

Chrome
Edge
Firefox
Safari
Opera
IE9+
YesYesYesYesYesYes

The <u> tag visually underlines the text to make it stand out, often used for stylistic emphasis without implying semantic importance.

Notes

  • <u> is an inline element and does not create a new line.
  • Use CSS for additional styling (color, font weight, underline style).
  • In HTML5, <u> is recommended for non-emphatic stylistic text, not for emphasis (use <em> or <strong> for that).
  • Avoid using <u> purely for emphasis, as it may be confused with hyperlinks.

Conclusion

The <u> tag is used to underline text, primarily for stylistic purposes.
It visually highlights content without changing semantic meaning, making it useful for names, special terms, or visually distinct text.