- Home
- /
- Tutorials
- /
- HTML Tutorial
- /
- HTML <u> Tag
HTML Tags
HTML <u> Tag
The u tag draws a line under text. Because links are underlined too, readers will try to click it. So u has a narrow job today: marking text that is unusual in some way, like a spelling mistake.
What u means in HTML5
In early HTML, <u> just meant "underline". HTML5 kept the tag but gave it a meaning: an unarticulated annotation, text marked as different without stressing it. The classic examples are spelling mistakes (the red squiggle in a word processor) and proper names in some Chinese texts.
If you want an underline only for looks, use CSS text-decoration: underline, explained in CSS Text Decoration.
Syntax
html
<u>Underlined text here</u>There are no special attributes, only the global ones such as class, id, style and title.
Example
Marking spelling mistakes with u
html
<!DOCTYPE html>
<html>
<head>
<title>U Tag Example</title>
<style>
u.spelling {
text-decoration: red wavy underline;
}
</style>
</head>
<body>
<h1>HTML <u> Tag Example</h1>
<p>
Please check this sentence: I <u class="spelling">recieved</u> the
parcel <u class="spelling">yesturday</u>.
</p>
</body>
</html>The two misspelled words get a wavy red underline, just like in a word processor. Plain <u> would give a straight line.
Browser Support
Chrome | Edge | Firefox | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| Yes | Yes | Yes | Yes | Yes | Yes |
Good to know
HTML <u> Tag exercises
Mark a misspelling
Write this paragraph and mark the misspelled word recieve: He wrote recieve again. Use the element made for marking text in a way that is not stress or importance.
Result
