How To Underline Text In HTML

ExploreEXPLORE THE CATALOGSupercharge your career with 700+ hands-on coursesView All CoursesPythonJavaJavaScriptCReactDockerVue JSRWeb DevDevOpsAWSC#LEARNING TOOLSExplore the industry's most complete learning platformCoursesLevel up your skillsSkill PathsAchieve learning goalsProjectsBuild real-world applicationsMock InterviewsNewAI-Powered interviewsPersonalized PathsGet the right resources for your goalsLEARN TO CODECheck out our beginner friendly courses.PricingFor BusinessResourcesNewsletterCurated insights on AI, Cloud & System DesignBlogFor developers, By developersFree CheatsheetsDownload handy guides for tech topicsAnswersTrusted answers to developer questionsGamesSharpen your skills with daily challengesSearchCoursesLog InJoin for freeHow 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:​

OutputHTMLCSS (SCSS)

Relevant Answers

Explore Courses

Free Resources

Copyright ©2025 Educative, Inc. All rights reserved

Tag » How To Underline On Html