<u>

Text with an annotation that can’t be expressed in words, most often a spelling-error mark.

Display
inline
Closing tag
Required
Permitted content
Phrasing content
On this page

Example

#
HTML
<p>
  Find the mistakes: this code is
  <u style="text-decoration: underline wavy #f43f5e;">unreadeble</u> and has
  <u style="text-decoration: underline wavy #f43f5e;">to much</u> repetition.
</p>
Preview

Definition and usage

#

The <u> element marks a piece of text with a non-textual annotation. Most often that’s flagging a spelling mistake, the way a text editor does. It’s also used in Chinese text to mark proper names. Browsers underline such text by default.

In practice, you’ll rarely need it. Underlining on the web is associated with links, so underlined text that can’t be clicked confuses users. <em> is for stress, <strong> for importance, <cite> for titles, and you can set plain underlining in CSS with the text-decoration property.

You can clearly tell spelling errors apart from links with a wavy underline: text-decoration: underline wavy red.

Syntax

#
Syntax
<u>text with an annotation</u>

Attributes

#

This element has no attributes of its own. It supports the global attributes, such as class, id and hidden.

Default CSS

#

Most browsers display this element with these default styles:

CSS
u {
  text-decoration: underline;
}

Browser support

#

Widely available

Works in all modern browsers, phones included. You can use it without worry.

  • Chrome
  • Edge
  • Firefox
  • Safari

Good practices

#
  • Don’t underline text for emphasis. Readers will try to click it.
  • Mark text added to a document with <ins>, not <u>.
  • You can change the underline style in CSS, e.g. to a wavy line for spelling errors.

Related entries

#

Spotted a mistake or missing an example? Write to us.