HTML <u> Tag
Topic: HTML5 Tags ReferencePrev|Next
Description
The <u> (short for underline) tag renders the enclosed text with an underline.
The following table summarizes the usages context and the version history of this tag.
| Placement: | Inline |
|---|---|
| Content: | Inline, and text |
| Start/End Tag: | Start tag: required, End tag: required |
| Version: | HTML 3.2, 4, 4.01, 5 |
Note: The <u> tag was deprecated in HTML 4, but it has been redefined in HTML5. However, it is better to avoid using this tag for underlining the text, because a user might confuse it with a hyperlink.
Syntax
The basic syntax of the <u> tag is given with:
The example below shows the <u> tag in action.
Example
Try this code »<p>Here is some <u>underlined text</u>.</p>
<!--Alternative-->
<p>Here is some <span style="text-decoration:underline;">underlined text</span>.</p>
Tag-Specific Attributes
The <u> tag doesn't have any specific attribute.
Global Attributes
Like all other HTML tags, the <u> tag supports the global attributes in HTML5.
Event Attributes
The <u> tag also supports the event attributes in HTML5.
Browser Compatibility
The <u> tag is supported in all major modern browsers.
Basic Support—
|
Further Reading
See tutorial on: HTML Text Formatting, CSS Fonts.
Related tag: <span>.

