HTML <u> Tag

<u> element creates an underlined text. It represents some text which must be different from normal text as style like misspelled words or proper nouns in Chinese.

We must avoid using the <u> element where it could be confused for a hyperlink.

You could use CSS (Cascading Style Sheets ) to style the text so that it is differentiated from hyperlinks.

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

Let's see an example:

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

We can use CSS text-decoration property instead of <u> element.

Let's see an example with CSS:

<!DOCTYPE html>
<html>
   <head>
      <title>Title of the document</title>
      <style>
         span{text-decoration:underline}
      </style>
   </head>
   <body>
      <p>Here we used <span> u element</span>.</p>
   </body>
</html>

Here the result is:


Attributes:

<u> element uses the Global Attributes.