Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

underline
text
html
css

How to underline text in HTML

Educative Answers Team

HTML text is easily underlined with the text-decoration CSS property.

svg viewer

Another way to underline text is with the <u> tag in HTML. Although this tag was deprecated in HTML 4.01, it was re-introduced in HTML5 to represent text that should be stylistically different from normal text.

It is preferable to use the text-decoration CSS property to underline text as it works on all browsers and provides additional styling options.

In the example below, the text-decoration property is used:​

RELATED TAGS

underline
text
html
css
Copyright ©2022 Educative, Inc. All rights reserved
RELATED COURSES

View all Courses

Keep Exploring