HTML <u> Tag

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 3 Examples
Text Formatting

What You’ll Learn

The <u> tag underlines text in HTML. This guide covers HTML5 semantics, syntax, styling with CSS, comparisons with similar tags, and beginner-friendly examples.

01

u Syntax

Wrap text between <u> opening and closing tags.

02

HTML5 Meaning

Unarticulated annotations—not general emphasis.

03

u vs ins vs em

Pick the right tag for your content type.

04

CSS Styling

Control underline color, thickness, and offset.

05

Common Patterns

Basic underlines, styled text, and annotations.

06

Accessibility

Avoid confusion with links and over-underlining.

What Is the <u> Tag?

The <u> element is an inline HTML tag that renders enclosed text with an underline. In HTML5, it represents an unarticulated non-textual annotation—text marked for a reason that is not spelled out in the content itself.

💡
HTML5 Semantics — Not for General Emphasis

Do not use <u> just to make words stand out. Use <em> for stress, <strong> for importance, and <ins> for inserted text during editing. Reserve u for annotations like misspelling marks or proper-name conventions in East Asian typography.

Browsers apply a default underline to <u> content. You can customize the appearance with CSS text-decoration properties while keeping the semantic meaning intact.

spelling-annotation.html
<p>You misspelled <u>recieve</u> — the correct spelling is <em>receive</em>.</p>

📝 Syntax

Enclose the text you want underlined between opening and closing <u> tags:

syntax.html
<u>Underlined Text Here</u>
  • <u> is an inline element—it nests inside paragraphs, headings, and lists.
  • Self-closing syntax (<u />) is not valid in HTML.
  • Style underlines with CSS instead of deprecated presentational attributes.

⚡ Quick Reference

Use CaseCode SnippetNotes
Basic underline<u>text</u>text (default underline)
Colored underlinestyle="text-decoration-color: #007bff;"colored
Thick underlinetext-decoration-thickness: 2pxthick
Spelling mark<u>misspelled</u>misspelled
AttributesGlobal onlyclass, id, style

⚖️ <u> vs <ins> vs <em>

These tags can all affect how text looks, but each carries a different meaning:

ElementMeaningBest for
<u>Unarticulated annotationSpelling marks, proper-name conventions
<ins>Inserted textDocument revisions and edit tracking
<em>Emphasized stressWords spoken with emphasis
<strong>Strong importanceWarnings and key instructions
<a>HyperlinkNavigation—already underlined by default

🎨 CSS Underline Styling

Modern CSS gives you fine control over underline appearance:

underline-styles.css
.fancy-underline {
  text-decoration-color: #ef4444;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.spell-mark {
  text-decoration-style: wavy;
  text-decoration-color: #dc2626;
}

For purely decorative underlines with no semantic meaning, a <span> with CSS is also acceptable.

🧰 Attributes

The <u> tag has no tag-specific attributes. Global attributes and CSS control styling:

class / id Global

Apply reusable underline styles via CSS classes.

<u class="fancy-underline">
style Inline

Quick one-off underline color or thickness.

style="text-decoration-color: #007bff;"

Avoid presentational attributes removed from HTML5. Use CSS for all visual underline customization.

Examples Gallery

Three practical patterns from basic underlines to styled text. Remember: in HTML5, use u for annotations—not general emphasis.

👀 Live Preview

See how underlined text appears in a paragraph:

Normal: This is regular paragraph text.

Underlined: This is an underlined word.

Styled: Explore our creative collection.

Styled Underline Text

Combine a CSS class with inline text-decoration-color for a custom underline color.

styled-underline.html
<u class="highlight" style="text-decoration-color: #007bff;">Styled Underline Text</u>
Try It Yourself

📚 Common Use Cases

Basic underlining patterns plus the proper HTML5 spelling-annotation use case.

Basic Underlining

Underline a single word inside a sentence. For emphasis, prefer <em> or <strong> instead.

basic-underlining.html
<p>This is an <u>important</u> message.</p>
Try It Yourself

Stylish Underlining with CSS

Apply a CSS class to control underline color and thickness for visually distinct text.

stylish-underlining.html
<style>
  .fancy-underline {
    text-decoration-color: red;
    text-decoration-thickness: 2px;
  }
</style>
<p>Explore our <u class="fancy-underline">creative</u> collection.</p>
Try It Yourself

Spelling Annotation (Proper HTML5 Use)

This is the intended HTML5 use: mark a misspelled word with u and explain the correction nearby.

spelling-mark.html
<p>
  You misspelled <u>recieve</u> — the correct spelling is <em>receive</em>.
</p>

♿ Accessibility

Underlined text needs careful use so readers are not confused:

  • Avoid link confusion — links are underlined by default; extra underlines can mislead users
  • Do not overuse — excessive underlining reduces readability and visual hierarchy
  • Use semantic tags — pick em, strong, or ins when meaning matters
  • Ensure contrast — colored underlines must meet WCAG contrast guidelines against the background
  • Provide context — explain spelling annotations or labels near the underlined text

🧠 How <u> Works

1

Author wraps text in u

Mark words that carry an unarticulated annotation or need an underline.

Markup
2

Browser applies underline

Default user-agent styles add text-decoration: underline to the content.

Rendering
3

CSS customizes appearance

Developers override color, thickness, and offset with modern CSS properties.

Styling
=

Semantic annotation, visual underline

Use u when the underline carries meaning—not just decoration.

Browser Support

The <u> tag is a standard HTML element with universal browser support.

HTML5 · Fully supported

Works everywhere

All major browsers render <u> with a default underline. CSS decoration properties are also widely supported for custom styling.

100% Browser support
Google Chrome Fully supported
Full support
Mozilla Firefox Fully supported
Full support
Apple Safari Fully supported
Full support
Microsoft Edge Fully supported
Full support
Internet Explorer Fully supported
Full support
Opera Fully supported
Full support
<u> tag 100% support

Bottom line: Use <u> with confidence across all browsers your users run today.

Conclusion

The <u> tag underlines text in HTML. In HTML5 it represents unarticulated annotations—not general emphasis. Use it for spelling marks and typographic conventions, style underlines with CSS, and reach for <em>, <strong>, or <ins> when semantics matter more than appearance.

💡 Best Practices

✅ Do

  • Use u for unarticulated annotations (spelling marks, proper names)
  • Style underlines with CSS text-decoration properties
  • Use em or strong for emphasis and importance
  • Use ins for text inserted during editing
  • Provide context near annotated text

❌ Don’t

  • Use u as a general emphasis or highlight tool
  • Underline large blocks of text—it hurts readability
  • Underline text that looks like a link without making it one
  • Confuse u with ins for revision tracking
  • Rely on underline alone to convey critical information

Key Takeaways

Knowledge Unlocked

Five truths every developer should know about <u>

Bookmark these before you underline your next paragraph.

5
Core concepts
💡 02

HTML5 Semantics

Represents unarticulated annotations—not general emphasis.

Essential
🎨 03

CSS Styling

Control color, thickness, and offset with text-decoration.

Styling
04

u vs ins vs em

Each tag has a distinct semantic purpose.

Comparison
05

Accessibility

Avoid confusion with links and over-underlining.

A11y

❓ Frequently Asked Questions

The <u> element represents text with an unarticulated non-textual annotation. Browsers render it with an underline by default.
No. Use <em> for stressed emphasis and <strong> for strong importance. The u tag is not a general emphasis tool.
ins marks text inserted during editing. u marks unarticulated annotations that are not insertions.
Yes. Use text-decoration-color, text-decoration-thickness, text-underline-offset, and text-decoration-style.
It can. Avoid underlining non-link text in navigation areas or use a distinct underline color to differentiate from links.
Yes. The u element is fully supported in all modern browsers and Internet Explorer.

Style underlines with CSS

Practice the <u> tag and custom underline styles in the Try It editor.

Try styled underline →

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.

5 people found this page helpful