- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set the kind of decoration used on text in CSS
To set the kind of decoration used on text, use the text-decoration-line Property. In CSS, we have the following options for text decoration −
text-decoration-line: none|underline|overline|line-through|initial|inherit;
Example
<!DOCTYPE html> <html> <head> <style> .demo { text-decoration: overline underline; text-decoration-color: blue; } </style> </head> <body> <h1>Details</h1> <p class="demo">Examination Center near ABC College.</p> <p class="demo2">Exam begins at 9AM.</p> </body> </html>
Output
Example
Let us now see another example −
<!DOCTYPE html> <html> <head> <style> span { text-decoration: line-through; text-decoration-color: blue; } .demo2 { text-decoration: underline; text-decoration-color: yellow; } </style> </head> <body> <h1>Details</h1> <p class="demo">Examination Center near <span>XYZ College</span> ABC College.</p> <p class="demo2">Exam begins at 11AM.</p> </body> </html>
Output
- Related Articles
- Set the color of the text decoration in CSS
- Set the style of the text decoration in CSS
- Text Decoration in CSS
- Text Decoration Using CSS
- Usage of text-decoration property in CSS
- Animate CSS text-decoration-color property
- How to set the decoration of a text with JavaScript?
- How to set the color of the text-decoration with JavaScript?
- How to set the type of line in a text-decoration with JavaScript?
- How to set the style of the line in a text decoration with JavaScript?
- How to Change Link Underline Color using text-decoration-color CSS
- Set the direction of a text with CSS
- Set the shadow around the text in CSS
- Set the text shadow around a text with CSS
- Set Text Alignment using CSS

Advertisements