HTML – Underline Tag

HTML Underline tag is used to underline text in a HTML Webpage. To stylise text or texts as underlined, we need to use underline tag.

Underline Tag

Underline tag – ‘<u></u>’. Underline tag too has close tag. Which ever text we want to set as underline stylised text, we wrap the text or texts with underline tag.

Example:

<u>Hello I am an underlined text</u>

When to use Underline Tag?

In most situation, we may want to draw extra attention of reader or viewer or user, upon certain text or texts. In such scenario, we use underline tag.

What does underline tag do in a HTML Webpage?

When a browser spots underline tag wrapped text (underline tagged elements), browser puts underline below the wrapped texts.

How to use underline tag in a webpage?

Lets see how to use underline tag:

Open the webpage which we have created in one of the previous chapter.

<html>

<head>

<title>This is a sample webpage</title>

<meta name=”content” description=”this is a sample webpage for practice purpose.”/>

</head>

<body>

This is a sample webpage. This webpage is for practice purpose. I have successfully developed the webpage.

</body>

</html>

Lets put underline below ‘sample webpage’.

Steps to use underline tag in HTML Webpage:

<body>

This is a <u>sample webpage. This webpage is for practice purpose. I have successfully developed the webpage.

</body>

<body>

This is a <u>sample webpage</u>. This webpage is for practice purpose. I have successfully developed the webpage.

</body>

Underline Tag HTML Webpage

In the image above you could see, there is underline below ‘sample webpage’ text.

Now experiment more. Try to put underline below entire all text. And also try to put underline below individual texts.