Upgrade & Secure Your Future with DevOps, SRE, DevSecOps, MLOps!

We spend hours on Instagram and YouTube and waste money on coffee and fast food, but won’t spend 30 minutes a day learning skills to boost our careers.
Master in DevOps, SRE, DevSecOps & MLOps!

Learn from Guru Rajesh Kumar and double your salary in just one year.



Get Started Now!

How to use text-decoration property in CSS?

CSS

This property is used to specify the decoration added to text.

  • text-decoration-line
  • text-decoration-style
  • text-decoration-color
  • text-decoration

text-decoration-line

This property is used to specify what type of line the decoration will have. We can set this property to none, underline, overline, line-through

We can combine more than one value, like underline and overline to display lines both under and over the text.

Ex:-

h1 { text-decoration-line: underline;}
h1 { text-decoration-line: underline overline;}

text-decoration-style

This property is used to specify how the line will display.

We can set this property to solid, double, dotted, dashed, wavy.

Ex:-

h1 { text-decoration-line: underline; text-decoration-style: dotted; }

text-decoration-color

This property is used to specify the color of the text-decoration-line.

Ex:-

h1 { text-decoration-line: underline; text-decoration-color: red; }

text-decoration

This is shorthand of all three text-decoration properties.

Syntax: –

Selector {text-decoration: text-decoration-line text-decoration-style text-decoration-color}

Ex:-

h1 {  text-decoration: underline dotted red ; }

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x