This website uses cookies

We use cookies to personalize content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners who may combine it with other information that you've provided to them or that they've collected from your use of their services. Please read more at our privacy policy page.



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>

Result

See an example with CSS text-decoration property.

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>

Result

Attributes

The <u> tag supports the Global attributes and the Event Attributes.

Browser support