

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Text Decoration in CSS
For text decoration in CSS, use the text-decoration property as a shorthand property for the following properties −
text-decoration-line text-decoration-color text-decoration-style
Example
Let us see an example for text decoration in CSS −
<!DOCTYPE html> <html> <head> <style> .demo { text-decoration: overline underline; } </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 wherein we are using separate values −
<!DOCTYPE html> <html> <head> <style> p { writing-mode: vertical-rl; text-decoration-line: overline; text-decoration-color: red; text-decoration-style: wavy; } </style> </head> <body> <h1>Demo Heading</h1> <p>This is demo text.</p> </body> </html>
Output
- Related Questions & Answers
- Text Decoration Using CSS
- Animate CSS text-decoration-color property
- Usage of text-decoration property in CSS
- Set the color of the text decoration in CSS
- Set the style of the text decoration in CSS
- Set the kind of decoration used on text in CSS
- How to Change Link Underline Color using text-decoration-color CSS
- How to set the decoration of a text with JavaScript?
- How to change the 'text-decoration' property with jQuery?
- How to set the color of the text-decoration with JavaScript?
- How to set the type of line in a text-decoration with JavaScript?
- Formatting Text in CSS
- CSS Text Shadow
- How to set the style of the line in a text decoration with JavaScript?
- Decorate a text in CSS
Advertisements