English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML tag大全

HTML: <u> tag

The text defined by the HTML <u> tag should be styled differently or have non-text annotations. Traditionally, browsers will display the text found within the <u> tag as underlined text. This tag is also commonly referred to as the <u> element.

Tip: If you want to underline text, you should use CSS (for example, text-decoration attribute) instead of <u> markers. Note that the underlined text should not be confused with hyperlinks.

Online Example

Use the <u> tag to add underlines to text:

!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>HTML u tag usage (Basic Tutorial Website oldtoolbag.com)</title>
</head>
<body>
<h1>Heading 1</h1>
<p>We want to annotate <u>this text</u>.</p>
</body>
</html>
Test to see ‹/›

In this HTML5In the document example, we created <u>markers to indicate non-text annotation text. By default, your browser will display 'this text' as underlined text. You can use CSS to override this behavior.

Browser Compatibility

IEFirefoxOperaChromeSafari

All major browsers support the <u> tag.

Definition and Usage of Tags

The <u> tag defines text with a style different from that of regular text, such as misspelled words or proper nouns in Chinese.

Tips and Notes

Tip:Please avoid using <u> to underline text, as users may confuse it with a hyperlink.

Note:HTML5 The specification recommends that developers use other elements instead of the <u> element as much as possible.

The <u> tag is used to set the text style to be different from regular text. Browsers use the underlined format to set the text found in the <u> tag. You can change this behavior using CSS.

HTML 4.01 and HTML5Differences between

In HTML, the <u> element is deprecated (the <u> element was used to define underlines).

HTML5 In HTML, the <u> element has been redefined, which defines text with a style different from that of regular text, such as misspelled words or proper nouns in Chinese.

Global attributes

Support for <u> tag Global attributes of HTML.

Event attributes

Support for <u> tag HTML event attributes.