Coding Hubs School of AI – Best AI & Full Stack Courses in Delhi NCR | 100% Placement
Limited Offer: Get 50% OFF on AI & Full Stack Courses
📞 Call Now: +91 8448811540
Back to HTML Notes
Topic #207

Underline Text (u)

The <u> tag renders an underline representing a non-textual annotation — like flagging a misspelled word, or marking a proper name in languages that use underlines for that purpose — not general emphasis or decoration.

Syntax

<u>text to underline</u>

Basic Example

<p>Draft note: this paragraph mentions <u>recieve</u> — check spelling before publishing.</p>

Browser output: the word "recieve" appears with an underline — the kind of annotation a proofreading or spell-check tool would apply, not a stylistic choice.

How It Works

The browser applies a default underline via CSS. Because underlines are the near-universal visual signal for a clickable link on the web, using <u> on plain text creates a real risk of confusing users into thinking it's a link.

Important Attributes

AttributePurpose
— none —Only universal global attributes apply

Real-World Example

Spelling and grammar checking tools (like a browser's built-in spellchecker, or a writing-assistant UI) commonly use an underline specifically to flag words needing review — a legitimate, narrow use of this annotation pattern.

Common Mistakes

  • Underlining text purely for decoration or emphasis — readers will very likely assume it's a broken or unstyled link
  • Using <u> as a shortcut for CSS text-decoration: underline on headings or titles where no annotation meaning is intended

Best Practices

  • Avoid underlining plain text for style — reserve underlines visually for links, and reserve <u> semantically for genuine non-textual annotation
  • For emphasis, use <em> or <strong>; for pure decoration, use CSS deliberately on a non-link element and be sure the context makes clear it isn't a link

Accessibility Considerations

Underlined non-link text can mislead users who rely on visual patterns to identify interactive elements, including some users with cognitive or visual processing differences who scan pages for underlines specifically to find links.

SEO Considerations

No direct ranking effect.

Browser & Modern HTML Notes

<u> is valid in HTML5 with this redefined annotation meaning, but it's one of the least-used inline text tags in modern web design specifically because of the link-confusion problem — most designs avoid it entirely.

Mini Practice

  1. Mark a misspelled word in a sample paragraph using <u> the way a spellchecker would.
  2. Find an example (real or hypothetical) of <u> being misused for decoration, and rewrite it using the correct tag instead.

Related HTML Notes

Want to go beyond the notes?

Join Coding Hubs School of AI's HTML course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available
💬 Talk to Advisor
1
WhatsApp

Latest from Our Blog

Insights on AI, Data Science, Full Stack & Career

View All Articles →