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 – ‘<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.
<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.
<title>This is a sample webpage</title>
<meta name=”content” description=”this is a sample webpage for practice purpose.”/>
This is a sample webpage. This webpage is for practice purpose. I have successfully developed the webpage.
Lets put underline below ‘sample webpage’.
Steps to use underline tag in HTML Webpage:
- Decide the beginning point. Here just before ‘sample’ is the beginning point. Place ‘<u>’ here.
This is a <u>sample webpage. This webpage is for practice purpose. I have successfully developed the webpage.
- Decide the end point. Here just after ‘webpage’ is the end point. Place ‘</u>’ here.
This is a <u>sample webpage</u>. This webpage is for practice purpose. I have successfully developed the webpage.
- Save the file. Open in any browser and you would see exact result as below.
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.