HTML Tags

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:

HTML / XHTML: <u> ... </u>

The example below shows the <u> tag in action.

<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.

Browsers Icon

Basic Support—

  • Firefox 1+
  • Google Chrome 1+
  • Internet Explorer 2+
  • Apple Safari 1+
  • Opera 4+

Further Reading

See tutorial on: HTML Text Formatting, CSS Fonts.

Related tag: <span>.

Bootstrap UI Design Templates Property Marvels - A Leading Real Estate Portal for Premium Properties