HTML <u> Tag

Beginner
5 min read
Updated: Nov 2026
4 examples
Live preview

Definition and Usage

The <u> element marks a span of text with a non-textual annotation (unarticulated annotation). Browsers usually draw a solid underline by default.

Valid uses include spelling hints and some proper-name marks. For decoration only, use CSS text-decoration: underline. Prefer <em>, <strong>, <mark>, or <cite> when those meanings fit (MDN).

Baseline · Widely available.

Not deprecated. HTML5 restored <u> with semantic meaning after it was discouraged as a pure underline tag in HTML 4.

Do not fake underlines or links.

Avoid default blue/black underlines that look like <a> hyperlinks. Style annotations clearly (e.g. red wavy underline for spelling).

HTML Syntax

syntax.html
<u> annotated text</u>

Both start and end tags are required. Content is phrasing content. Parent must accept phrasing content.

Attributes

<u> has no element-specific attributes — only globals. Choose the right tool for the job:

UseDescriptionTry it
<u>Non-textual annotation (e.g. spelling mark)Try it
CSS underlineDecoration only — text-decoration: underlineTry it
<cite>Book / work titles (not u)Try it
<em> / <mark>Stress emphasis / highlighted relevanceSee related
<a>Real hyperlinks — never fake with uTry it

Global Attributes

The <u> tag also supports the Global Attributes in HTML.

Live Preview

Compare a spelling annotation, a CSS-only underline, and a real link so you can see the difference.

demo style

Prefer a distinct style for <u> so it does not look like a link.

Preview

This paragraph includes a wrnogly spelled word.

Using <u> with a spelling-style underline (not a link).

HTML Examples

Short, copy-ready snippets. Use Try It Yourself for a live editor.

Example 1 — Spelling Annotation

Mark a misspelling with <u> and style it like a word processor (red wavy line).

HTML
<style>
  u.spelling {
    text-decoration: red wavy underline;
  }
</style>

<p>
  This paragraph includes a
  <u class="spelling">wrnogly</u>
  spelled word.
</p>
Try It Yourself

How It Works

  1. Wrap the annotated word in <u>.
  2. Add a class (e.g. spelling) so you can style the annotation.
  3. Set CSS such as text-decoration: red wavy underline.
  4. Meaning: the underline is a hint, not a hyperlink.

Example 2 — Decorative Underline (No u)

When the line is only visual, use CSS — not the u element.

HTML
<style>
  .underline {
    text-decoration: underline;
  }
</style>

<p>
  <span class="underline">Today’s Special</span><br>
  Chicken noodle soup
</p>
Try It Yourself

How It Works

  1. Ask: is this an annotation, or just a look?
  2. Look only → use a span (or heading) + CSS underline.
  3. Annotation → use <u> (and style it so it is not link-like).
  4. Skip u when there is no non-textual annotation meaning.

Example 3 — Book Titles Use cite

Do not mark titles with u. Use cite (optionally restyle with CSS).

HTML
<p>
  The class read <cite>Moby-Dick</cite> in the first term.
</p>
Try It Yourself

How It Works

  1. Wrap the work title in <cite>.
  2. Default look is often italics (browser-dependent).
  3. Override with CSS if you want an underline on cite instead.
  4. Do not use u for titles (MDN guidance).

Edge Cases & Pitfalls

Most problems come from treating u as a generic “underline button.”

a11y

Default underline looks like a link

Style annotations so they are distinct from <a> defaults (color, wavy/dashed style, etc.).

semantics

Decoration ≠ annotation

Pure looks belong in CSS text-decoration, not in <u>.

titles

Use cite for works

Book and publication titles go in <cite>, not u.

emphasis

Stress and importance need other tags

Prefer <em> and <strong> when that is the meaning.

history

HTML 4 vs HTML5 meaning

Old tutorials treated u as “underline.” HTML5 meaning is annotation — update old habits.

Browser Support

The <u> element is core HTML phrasing content in every modern browser. It is not a Node.js, Deno, or Bun API.

✓ Baseline · Widely available

<u>

Widely available since about July 2015 (and long before). Chrome, Firefox, Safari, Edge, and Opera all support u with a default underline.

98% Global support (approx.)
Google Chrome All
Full support
Mozilla Firefox All
Full support
Apple Safari All
Full support
Microsoft Edge All
Full support
Opera All
Full support
Samsung Internet All
Full support
Internet Explorer All
Supported
<u> Widely supported

Bottom line: Safe to use for real annotations. Style them so they are not mistaken for links, and use CSS for decoration-only underlines.

Key Takeaways

  • Meaning: <u> = non-textual annotation (often looks underlined).
  • Decoration: use CSS text-decoration, not u.
  • Titles / links: use cite and a, never fake them with u.
  • Style annotations so they are clearly not hyperlinks.

One line: use <u> for annotations; use CSS for decoration and <a> for links.

Default CSS Settings

Typical user-agent styling for u:

default.css
u {
  text-decoration: underline;
}

/* Example: spelling annotation (prefer a class) */
u.spelling {
  text-decoration: red wavy underline;
}

Customize with text-decoration, text-decoration-color, and text-decoration-style.

Frequently Asked Questions

The u element marks inline text that has a non-textual annotation — for example a spelling hint or a proper-name mark. Browsers usually show a solid underline by default.
No. For decoration only, use CSS text-decoration: underline on a span or other element. Reserve u for real unarticulated annotations (MDN).
Yes. Default underlines look like hyperlinks. Style annotated u text differently (for example a red wavy underline for spelling) and never use u to fake a link — use the a element.
Use the cite element, not u. You can restyle cite with CSS if you want an underline instead of italics.
No. Only global attributes such as class, id, and lang. Use a class when you need a special underline style.
No. It was discouraged as a pure underline tag in HTML 4, then restored in HTML5 with semantic meaning. It is Baseline and widely available — use it carefully, not for decoration.

Next: ul

Build unordered lists with the HTML ul element.

ul tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

11 people found this page helpful