Tag text-decoration-line

✍️ CSS text-decoration-line — Drawing Lines on Text Content

The text-decoration-line property specifies what kind of decorative line you want to add to your text: underline, overline, line-through (strikethrough), or any combination of these.

It’s a part of the text-decoration shorthand, but you can use it on its own for fine-tuned styling.


🔹 What Does text-decoration-line Do?

It controls where the line appears relative to the text:

  • underline — below the text
  • overline — above the text
  • line-through — across the text (strikethrough)

📘 Syntax

selector {
text-decoration-line: underline | overline | line-through | none | multiple;
}

💡 Values Explained

ValueDescription
noneNo decoration at all
underlineLine below the text
overlineLine above the text
line-throughLine through the middle (like “crossed out”)
CombinationYou can combine multiple (e.g., underline overline)

✍️ Example: Underlined and Struck-Through Text

<p class="multi-line">This text has multiple decorations.</p>
.multi-line {
text-decoration-line: underline line-through;
}

✅ Result: The text will have both an underline and a strikethrough.


🖼️ Image Idea: Visual Display of Each Decoration

Image Description:
Show the same word three times:

  • One with underline
  • One with overline
  • One with line-through
  • And a fourth with all three combined

🎯 Purpose: Help visually distinguish the placement and combination of lines.


🎨 Combine with Other Decoration Properties

You can pair text-decoration-line with:

Example:

.decorated {
text-decoration-line: underline;
text-decoration-color: crimson;
text-decoration-style: dashed;
text-decoration-thickness: 2px;
}

✅ Best Use Cases

Use CaseRecommended Line
Hyperlinksunderline
Old prices or deleted itemsline-through
Highlight headings subtlyoverline
Visual emphasisCombine underline overline

🔄 Browser Support

  • ✅ Widely supported across all modern browsers
  • ⚠️ Older browsers may not support combination values or custom styles

🧠 Accessibility Tip

Use text-decoration-line alongside text-decoration-color and text-decoration-thickness for better visibility and accessibility, especially for users with visual impairments.


✅ Summary

Propertytext-decoration-line
PurposeDraw lines on, above, or below text
Typical valuesunderlineoverlineline-through
Can combine multipleYes
Works withtext-decoration-colorstylethickness