CSS text-decoration-thickness Property

Beginner
⏱️ 5 min read
📚 Updated: Jun 2026
🎯 4 Examples
Typography

What You’ll Learn

The text-decoration-thickness property controls how thick decoration lines appear — using auto, from-font, length, or percentage values.

01

auto

Browser picks.

02

from-font

Font metrics.

03

length

px or em.

04

percentage

Font relative.

05

Longhand

Thickness only.

06

Pair

Line + style.

Introduction

The text-decoration-thickness property in CSS allows web developers to control the thickness of text decoration lines, such as underlines, overlines, and line-throughs.

This property provides more fine-grained control over the appearance of these decorations, allowing for better customization and design flexibility.

Definition and Usage

Use text-decoration-thickness when a decoration line already exists and you want to make it thicker or thinner. Pair it with text-decoration-line, text-decoration-style, and text-decoration-color for full control.

It is the longhand alternative to setting thickness inside the text-decoration shorthand.

💡
Beginner Tip

Set a decoration line first with text-decoration: underline;, then adjust thickness with values like 3px or 0.1em.

📝 Syntax

The syntax for the text-decoration-thickness property is straightforward. It can be applied to any text element, and you can specify the thickness using various units or keywords:

syntax.css
element {
  text-decoration-thickness: value;
}

Here, value can be a length (e.g., 2px, 0.1em), a percentage, or a keyword.

Basic Example

thick-underline.css
p {
  text-decoration: underline;
  text-decoration-thickness: 3px;
}

Syntax Rules

  • Set a decoration line before applying text-decoration-thickness.
  • Use keywords auto or from-font, or length values like 2px and 0.1em.
  • Percentage values are relative to the element’s font size.
  • Pair with line, style, and color longhands for complete decoration control.

Related Properties

  • text-decoration — shorthand for line, style, color, and thickness
  • text-decoration-line — sets which lines appear
  • text-decoration-style — sets solid, dotted, dashed, or wavy lines
  • text-decoration-color — sets decoration line color

🎯 Default Value

The default value of the text-decoration-thickness property is auto, which means the thickness is determined by the browser and is typically based on the font size and type.

⚡ Quick Reference

QuestionAnswer
Default valueauto
Common valuesauto, from-font, 2px, 0.1em
Thick underlinetext-decoration-thickness: 3px;
Pair withtext-decoration-line, text-decoration-style
InheritedNo
AnimatableNo

💎 Property Values

ValueExampleDescription
autotext-decoration-thickness: auto;The browser determines the thickness.
from-fonttext-decoration-thickness: from-font;Uses the thickness specified by the font (if supported).
lengthtext-decoration-thickness: 2px;Specifies the thickness using a length value (e.g., 2px, 0.1em).
percentagetext-decoration-thickness: 10%;Specifies the thickness as a percentage of the element’s font size (e.g., 10%).
auto from-font 2px 0.1em 10%

When to Use text-decoration-thickness

text-decoration-thickness is the right choice when you need precise control over decoration line weight:

  • Links — Make underlines bolder for better visibility on large headings.
  • Accessibility — Increase underline thickness so link cues are easier to see.
  • Branding — Match decoration weight to your design system spacing scale.
  • Responsive text — Use em or % so thickness scales with font size.

👀 Live Preview

Compare different text-decoration-thickness values on underlined text:

Auto thickness underline.
Thin 1px underline.
Medium 3px underline.
0.15em scalable underline.
12% font-relative underline.

Examples Gallery

In this example, we’ll set the thickness of the underline for a paragraph to 3px, then explore practical thickness patterns.

📜 Decoration Line Thickness

Control how thick underlines and strike-throughs appear on text.

Example 1 — Thick underline on a paragraph

In this example, we’ll set the thickness of the underline for a paragraph to 3px.

index.html
<style>
  p {
    text-decoration: underline;
    text-decoration-thickness: 3px;
  }
</style>

<p>This is an example paragraph with a thick underline.</p>
Try It Yourself

How It Works

The browser draws a 3-pixel-thick underline beneath the paragraph text.

📄 Practical Use Cases

Adjust strike-through weight and combine thickness with style and color.

Example 3 — Thin line-through for sale prices

Use a thin strike-through so the old price stays readable but clearly discounted.

sale-thin.css
.old-price {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
  color: #94a3b8;
}
Try It Yourself

How It Works

A thinner strike-through keeps the price legible while still showing it is no longer active.

Example 4 — Full decoration with thickness

Combine line, style, color, and thickness longhands for a polished help link.

full-decoration.css
.help-link {
  text-decoration-line: underline;
  text-decoration-style: wavy;
  text-decoration-color: #dc2626;
  text-decoration-thickness: 2px;
}
Try It Yourself

How It Works

Thickness is the final longhand piece that fine-tunes how bold the decoration line appears.

text-decoration-thickness in the family

text-decoration-thickness controls line weight. Combine it with text-decoration-line, text-decoration-style, and text-decoration-color, or use the text-decoration shorthand when you want all parts in one declaration.

decoration-set.css
.brand-link {
  text-decoration-line: underline;
  text-decoration-color: #2563eb;
  text-decoration-thickness: 0.12em;
}

🧠 How text-decoration-thickness Works

1

A decoration line exists

The element has underline, overline, or line-through from text-decoration.

Line
2

You set the thickness

Choose auto, from-font, a length, or a percentage.

Thickness
3

Browser draws the weighted line

The decoration appears with your chosen thickness along the text glyphs.

Rendering
=

Precise decoration weight

Links and emphasis lines match your design and readability goals.

Browser Compatibility

The text-decoration-thickness property is supported in most modern browsers, including current versions of Chrome, Firefox, Safari, Edge, and Opera. However, it is always a good practice to test your website across different browsers to ensure compatibility.

Modern browsers · Wide support

Reliable thickness control

Chrome, Firefox, Safari, Edge, and Opera all support text-decoration-thickness in current versions.

96% Modern browser support
Google Chrome 57+ · Desktop & Mobile
Full support
Mozilla Firefox 36+ · Desktop & Mobile
Full support
Apple Safari 8+ · macOS & iOS
Full support
Microsoft Edge 79+ · Chromium
Full support
Opera 44+ · Modern versions
Full support

Testing tip

Verify thick underlines and em-based thickness in Safari and Firefox on mobile devices.

text-decoration-thickness property 96% supported

Bottom line: text-decoration-thickness is safe to use for bold link underlines and readable decoration lines in modern projects.

Conclusion

The text-decoration-thickness property is a valuable addition to CSS, providing developers with greater control over text decoration aesthetics.

By customizing the thickness of text decoration lines, you can enhance the visual appeal and readability of your text. Experiment with different values to see how this property can improve your web designs.

💡 Best Practices

✅ Do

  • Set a decoration line before applying text-decoration-thickness
  • Use em or % when thickness should scale with font size
  • Use px for consistent underline weight across mixed text sizes
  • Pair with text-decoration-color for accessible link styling
  • Test thick underlines on links in Safari and mobile browsers

❌ Don’t

  • Expect thickness changes without an active decoration line
  • Use extremely thick underlines that reduce text readability
  • Confuse decoration thickness with border-width
  • Rely on thick underlines alone for critical accessibility cues

Key Takeaways

Knowledge Unlocked

Five things to remember about text-decoration-thickness

Use these points when controlling decoration line weight.

5
Core concepts
02

3px

Fixed weight.

Length
03

0.1em

Scales up.

Length
04

Line first

Needs underline.

Rule
🔄 05

text-decoration

Shorthand pair.

Companion

❓ Frequently Asked Questions

text-decoration-thickness sets how thick decoration lines appear, such as underlines, overlines, and line-throughs.
The default value is auto, which lets the browser choose a thickness based on the font and decoration type.
Yes. A decoration line must exist first. Set text-decoration or text-decoration-line such as underline or line-through.
Use px for fixed thickness. Use em or percentage when you want thickness to scale with the element font size.
from-font uses thickness information from the font itself when the font provides underline metrics.

Practice in the Live Editor

Open the HTML editor and try text-decoration-thickness: 3px; with text-decoration: underline;.

HTML Editor →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

5 people found this page helpful