🔥Limited Offer: Get 50% OFFon AI & Full Stack Courses🔥
Back to CSS Notes
Topic #42

Text Decoration Styles


Specify a Style for the Decoration Line

The CSS text-decoration-style property sets the style of the decoration line.

This property can have one of the following values:

  • solid - Default value. Single line
  • double - Double line
  • dotted - Dotted line
  • dashed - Dashed line
  • wavy - Wavy line

Example

  h1 {
  text-decoration-line: underline;

  text-decoration-style: solid;
}

h2 {
  text-decoration-line: underline;

  text-decoration-style: double;
}

h3 {
  text-decoration-line: underline;

  text-decoration-style: dotted;
}

p.ex1 {
  text-decoration-line: underline;

  text-decoration-style: dashed;
}

p.ex2 {
  text-decoration-line: underline;

  text-decoration-style: wavy;
}

p.ex3 {
  text-decoration-line:
  underline;
  text-decoration-color: red;

  text-decoration-style: wavy;
}

Specify the Thickness for the Decoration Line

The CSS text-decoration-thickness property is used to set the thickness of the decoration line.

Example

  h1 {
  text-decoration-line: underline;

  text-decoration-thickness: auto;
}

h2 {
  text-decoration-line:
  underline;
  text-decoration-thickness: 5px;
}

h3 {

  text-decoration-line: underline;
  text-decoration-thickness: 25%;

  }

p {

  text-decoration-line: underline;
  text-decoration-color: red;

  text-decoration-style: double;
  text-decoration-thickness: 5px;
}

The Shorthand Property

The CSS text-decoration property is a shorthand property for:

  • text-decoration-line (required)
  • text-decoration-color (optional)
  • text-decoration-style (optional)
  • text-decoration-thickness (optional)

Example

  h1 {
  text-decoration: underline;
}

h2 {

  text-decoration: underline red;
}

h3 {
  text-decoration: underline
  red double;
}

p {

  text-decoration: underline red double 5px;
}

All links in HTML are underlined by default. Sometimes you see that links are styled with no underline. The text-decoration: none; is used to remove the underline from links, like this:

Example

a {
  text-decoration: none;
}

Want to go beyond the notes?

Join CodingNow 2.0's CSS course — live mentorship, real projects, and 100% placement support.

Enroll Now — Free Demo Available

Text Decoration Styles – FAQs

Quick answers about learning Text Decoration Styles in CSS.

This free note from CodingNow 2.0 explains Text Decoration Styles in CSS — concept, syntax and worked code examples you can copy, run and revise before interviews.
Yes. Every CSS topic on CodingNow 2.0, including Text Decoration Styles, is 100% free with no signup required.
With focused practice, most students grasp Text Decoration Styles in 1–3 days from these notes; pairing it with CodingNow 2.0's mentor-led course takes you to job-ready depth faster.
Use the code examples in this note, then ask doubts for free on the CodingNow 2.0 Community (/community) — expert instructors answer within 24 hours.
WhatsApp
Call NowEnroll Now