How to underline text in HTML

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:​

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved