🚀 LEVEL UP TO SENIOR:Unlock 500+ Advanced Practical Challenges & Exercises.
🎓 COURSERA PARTNER:Earn professional Google, Meta, and IBM certificates to supercharge your resume.
REFERENCEhtml

html Documentation

LOADING ENGINE...

<u>

AI & DATA SCIENCE // u-tag

The <u> element renders an unarticulated, non-textual annotation — commonly shown as an underline — such as marking a misspelling or a proper name, without implying emphasis or a hyperlink.

Syntax

<p>The word <u>seperate</u> is misspelled.</p>

Deep Dive Course

**`<u>`** is one of the more misunderstood elements: it looks like a plain underline, which historically was used for links, so many developers avoid it to prevent confusing users into thinking underlined text is clickable. Semantically, HTML5 redefined `<u>` to represent a **non-textual annotation** — for example, marking a spelling error (as a spell-checker would), labeling a proper name in Chinese text (a traditional annotation convention), or similar 'this is marked, but not for emphasis' cases. It's not meant as a generic 'underline for style' tag.

1Understanding <u>

`<u>` is one of the more misunderstood elements: it looks like a plain underline, which historically was used for links, so many developers avoid it to prevent confusing users into thinking underlined text is clickable. Semantically, HTML5 redefined <u> to represent a non-textual annotation — for example, marking a spelling error (as a spell-checker would), labeling a proper name in Chinese text (a traditional annotation convention), or similar 'this is marked, but not for emphasis' cases. It's not meant as a generic 'underline for style' tag.

💡

If you just want underlined text for visual style, use CSS text-decoration: underline instead — and never use <u> (or CSS underline) on plain non-link text near actual links, since it creates confusing visual ambiguity.

editor.html
<p>Please review this <u>drafted</u> section before publishing.</p>
localhost:3000

2Practical Example

Here is a real-world application of <u> showing how it is used in production HTML.

editor.html
<!-- Marking a misspelling, similar to a spell-checker's red squiggle -->
<p>I recieved <u>recieved</u> your message. <!-- should be "received" --></p>
localhost:3000

3Best Practices

Follow these guidelines when working with <u>:

1. Reserve <u> for genuine non-textual annotations (spelling markup, proper name marks), not generic styling

2. Use CSS text-decoration: underline for purely visual underlines

3. Avoid underlining non-link text anywhere near real links, to prevent confusing users

⚠️

Tip: If you just want underlined text for visual style, use CSS text-decoration: underline instead — and never use <u> (or CSS underline) on plain non-link text near actual links, since it creates confusing visual ambiguity.

editor.html
<p>Please review this <u>drafted</u> section before publishing.</p>
localhost:3000

Examples

Example 01Basic Usage
<p>Please review this <u>drafted</u> section before publishing.</p>
Example 02Advanced Example
<!-- Marking a misspelling, similar to a spell-checker's red squiggle -->
<p>I recieved <u>recieved</u> your message. <!-- should be "received" --></p>

Best Practices

  • Reserve for genuine non-textual annotations (spelling markup, proper name marks), not generic styling
  • Use CSS text-decoration: underline for purely visual underlines
  • Avoid underlining non-link text anywhere near real links, to prevent confusing users

Interview Question

Why do many style guides recommend avoiding <u>, and what should you use instead for simple styling?

Hint: Think about what underlined text conventionally signals to web users.

Underlined text is a strong, decades-old visual convention for hyperlinks on the web. Using <u> (or CSS underline) on regular text risks making users think it's clickable, especially if it appears near actual links. If you need underline purely for visual styling with no annotation meaning, use CSS text-decoration: underline on a <span> instead, and reserve <u> for its narrow semantic purpose — non-textual annotations like marked misspellings.

Exercises

EasyPractice using <u> in a real scenario.
View Solution
<p>Please review this <u>drafted</u> section before publishing.</p>

Frequently Asked Questions

Why do many style guides recommend avoiding <u>, and what should you use instead for simple styling?

Underlined text is a strong, decades-old visual convention for hyperlinks on the web. Using (or CSS underline) on regular text risks making users think it's clickable, especially if it appears near actual links. If you need underline purely for visual styling with no annotation meaning, use CSS text-decoration: underline on a instead, and reserve for its narrow semantic purpose — non-textual annotations like marked misspellings.

Related Functions

s-tagins-tagspan-tag