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.
Fundamentals
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.
Foundation
📝 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.
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
Defaults
🎯 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.
Cheat Sheet
⚡ Quick Reference
Question
Answer
Default value
auto
Common values
auto, from-font, 2px, 0.1em
Thick underline
text-decoration-thickness: 3px;
Pair with
text-decoration-line, text-decoration-style
Inherited
No
Animatable
No
Reference
💎 Property Values
Value
Example
Description
auto
text-decoration-thickness: auto;
The browser determines the thickness.
from-font
text-decoration-thickness: from-font;
Uses the thickness specified by the font (if supported).
length
text-decoration-thickness: 2px;
Specifies the thickness using a length value (e.g., 2px, 0.1em).
percentage
text-decoration-thickness: 10%;
Specifies the thickness as a percentage of the element’s font size (e.g., 10%).
autofrom-font2px0.1em10%
Context
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.
Preview
👀 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.
Hands-On
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>
Thickness is the final longhand piece that fine-tunes how bold the decoration line appears.
Companion
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.
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.
Compatibility
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 Chrome57+ · Desktop & Mobile
Full support
Mozilla Firefox36+ · Desktop & Mobile
Full support
Apple Safari8+ · macOS & iOS
Full support
Microsoft Edge79+ · Chromium
Full support
Opera44+ · Modern versions
Full support
Testing tip
Verify thick underlines and em-based thickness in Safari and Firefox on mobile devices.
text-decoration-thickness property96% supported
Bottom line:text-decoration-thickness is safe to use for bold link underlines and readable decoration lines in modern projects.
Wrap Up
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.