- 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 style of the text decoration in CSS
To set the style of the text decoration, use the text-decoration-style property. You can use the following values −
text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit;
Example
<!DOCTYPE html> <html> <head> <style> span { text-decoration: line-through; text-decoration-color: blue; } .demo2 { text-decoration: underline; text-decoration-style: double; text-decoration-color: red; } </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
Example
Let us now see another example −
<!DOCTYPE html> <html> <head> <style> .demo { text-decoration: overline; text-decoration-color: blue; text-decoration-style: wavy; } .demo2 { text-decoration: overline; text-decoration-style: dashed; text-decoration-color: red; } </style> </head> <body> <h1>Details</h1> <p class="demo">Examination Center near 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 kind of decoration used on text in CSS
- How to set the style of the line in a text decoration with JavaScript?
- Text Decoration in CSS
- Text Decoration Using CSS
- Usage of text-decoration property in CSS
- How to set the decoration of a text with JavaScript?
- How to set the color of the text-decoration with JavaScript?
- Animate CSS text-decoration-color property
- How to set the type of line in a text-decoration with JavaScript?
- Set the style of the border with CSS
- Set the font style with CSS
- Set the style of the bottom border using CSS
- Set the style of the rule between columns with CSS
- Set the shadow around the text in CSS

Advertisements