HTML <u> Tag

In HTML 4.01 the <u> element was used to specify underlined text. In HTML 5 the <u> tag specifies text that is stylistically different from normal text, i.e. words or fragments of text that need to be presented differently. This could be misspelled words or proper nouns in Chinese.

The text in the <u> tag is being underlined (unless you style it otherwise).

This element should not be used just to underline the text. For this purpose, use CSS text-decoration property set to “underline”.

Syntax

The <u> element comes in pairs. The content is written between opening (<u>) and closing (</u>) elements.

Example

<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document</title>
  </head>
  <body>
    <p>Here we used <u>the &lt;u&gt; element</u>.</p>
  </body>
</html>

Example

<!DOCTYPE html>
<html>
  <head>
    <title>The title of the document.</title>
    <style>
      span {
        text-decoration: underline;
      }
    </style>
  </head>
  <body>
    <p>Here we used <span> CSS property text-decoration:underline</span>.</p>
  </body>
</html>

Attributes

The <u> tag supports the Global Attributes.