CSS Properties: How to set the text decoration for heading elements
Solution:
HTML Code:
<!DOCTYPE html>
<html>
<head>
<title>How to set the text decoration for heading elements</title>
<style type="text/css">
h1 {
text-decoration: overline;
}
h2 {
text-decoration: underline;
}
h3 {
text-decoration: line-through;
}
</style>
</head>
<body>
<p><strong>w3resource Tutorial</strong></p>
<h1>Heading 1 - overline</h1>
<h2>Heading 2 - underline</h2>
<h3>Heading 3 - line-through</h3>
</body>
</html>
Live Demo :
See the Pen text-decoration-answer by w3resource (@w3resource) on CodePen.
See the solution in the browser
Supported browser
![]() |
![]() |
![]() |
![]() |
![]() |
Yes | Yes | Yes | Yes | Yes |
What is the difficulty level of this exercise?
Test your Programming skills with w3resource's quiz.
- Weekly Trends
- Python Interview Questions and Answers: Comprehensive Guide
- Scala Exercises, Practice, Solution
- Kotlin Exercises practice with solution
- MongoDB Exercises, Practice, Solution
- SQL Exercises, Practice, Solution - JOINS
- Java Basic Programming Exercises
- SQL Subqueries
- Adventureworks Database Exercises
- C# Sharp Basic Exercises
- SQL COUNT() with distinct
- JavaScript String Exercises
- JavaScript HTML Form Validation
- Java Collection Exercises
- SQL COUNT() function
- SQL Inner Join