The
<u>tag in HTML is used to underline text.
Originally,<u>was purely stylistic, but in modern HTML5, it can also indicate non-emphatic text that should be stylistically different, such as proper names, misspelled words, or terms needing attention.
It is an inline element.
Syntax
<u>Underlined text here</u>Attributes
| Attribute | Description |
|---|---|
class | Assigns one or more class names for styling. |
id | Assigns a unique identifier to the element. |
style | Adds inline CSS styles to customize appearance. |
title | Provides additional information as a tooltip. |
Example
<!DOCTYPE html>
<html>
<head>
<title>U Tag Example</title>
<style>
.underline {
text-decoration: underline;
color: #1a237e;
}
</style>
</head>
<body>
<h1>HTML <u> Tag Example</h1>
<p>
This is an <u class="underline" id="important-word" title="Underlined Text">underlined word</u> in a paragraph.
</p>
<p>
Example: Please read the <u>Terms and Conditions</u> carefully.
</p>
</body>
</html>Output
Browser Output
Use our TryIt Editor to see the output.
Browser Support
Chrome | Firefox | Edge | Safari | Opera | IE9+ |
|---|---|---|---|---|---|
| ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes | ✅Yes |
The <u> tag visually underlines the text to make it stand out, often used for stylistic emphasis without implying semantic importance.
Notes
<u>is an inline element and does not create a new line.- Use CSS for additional styling (color, font weight, underline style).
- In HTML5,
<u>is recommended for non-emphatic stylistic text, not for emphasis (use<em>or<strong>for that). - Avoid using
<u>purely for emphasis, as it may be confused with hyperlinks.
Conclusion
The <u> tag is used to underline text, primarily for stylistic purposes.
It visually highlights content without changing semantic meaning, making it useful for names, special terms, or visually distinct text.