Home HTML Tags <u> HTML <u> Tag Definition
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).
Syntax
HTML Syntax Both start and end tags are required. Content is phrasing content. Parent must accept phrasing content.
Reference
Attributes <u> has no element-specific attributes — only globals. Choose the right tool for the job:
Try it
Live Preview Compare a spelling annotation, a CSS-only underline, and a real link so you can see the difference.
Code
HTML Examples Short, copy-ready snippets. Use Try It Yourself for a live editor.
1. Spelling mark 2. CSS underline 3. Book title 4. Not a link Example 1 — Spelling Annotation Mark a misspelling with <u> and style it like a word processor (red wavy line).
<style>
u.spelling {
text-decoration: red wavy underline;
}
</style>
<p>
This paragraph includes a
<u class="spelling">wrnogly</u>
spelled word.
</p> This paragraph includes a wrnogly spelled word.
How It Works Wrap the annotated word in <u>.Add a class (e.g. spelling) so you can style the annotation.Set CSS such as text-decoration: red wavy underline.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.
<style>
.underline {
text-decoration: underline;
}
</style>
<p>
<span class="underline">Today’s Special</span><br>
Chicken noodle soup
</p> Today’s Special Chicken noodle soup
How It Works Ask: is this an annotation, or just a look?Look only → use a span (or heading) + CSS underline.Annotation → use <u> (and style it so it is not link-like).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).
<p>
The class read <cite>Moby-Dick</cite> in the first term.
</p> The class read Moby-Dick in the first term.
How It Works Wrap the work title in <cite>.Default look is often italics (browser-dependent).Override with CSS if you want an underline on cite instead.Do not use u for titles (MDN guidance).Example 4 — Links Need a, Not u Underlined text that navigates must be a real anchor.
<!-- Wrong: looks clickable, is not a link -->
<p><u>Read the docs</u></p>
<!-- Correct -->
<p>
<a href="/html">Read the docs</a>
</p> How It Works Underline alone does not create navigation.Use <a href="…"> for real destinations.Keep annotated u styled differently from default link underlines.Keyboard and screen reader users need a real link, not a fake underline. 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.
Compatibility
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.
Remember
Key Takeaways One line: use <u> for annotations; use CSS for decoration and <a> for links.
Frequently Asked Questions What is the HTML u tag used for? 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.
Should I use u just to underline text? No. For decoration only, use CSS text-decoration: underline on a span or other element. Reserve u for real unarticulated annotations (MDN).
Can u be confused with links? 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.
What should I use for book titles? Use the cite element, not u. You can restyle cite with CSS if you want an underline instead of italics.
Does the u tag have special attributes? No. Only global attributes such as class, id, and lang. Use a class when you need a special underline style.
Is the u tag deprecated? 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 Developer, cloud engineer, and technical writer
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
Helpful Share Copy link Suggestion