How to make text underlined in HTML

problem

You wish to make some text appear in underlined format. In this post we will see how to do that using HTML tags.

SOLUTION

We can use the Underline tag <u>. It has an opening and a closing tag for us to enclose the text we wish to make underlined. It works similarly to the bold and italic tags.

For example, make a line of text underlined:

underline.html
				
					<u>A line of text underlined.</u>
				
			
output
Underline a line of text in HTML
Nested example - Make a substring underlined
underline.html
				
					<p>
    Example of substring <u>underlined</u>
</p>
				
			

We can use the <u> tag as a nested tag. In the example above is nested inside a paragraph tag.

output
Underline a substring in HTML

conclusion

In this post we saw how to use the underline tag and make some text underlined or a substring.

Share it!

Facebook
Twitter
LinkedIn
Reddit
Picture of Ellion

Ellion

Professional IT consultant, writer, programmer enthusiast interested in all sorts of coding.
Eats all cookies 🍪

0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x