Skip to main content
HTML Validation

CSS: “text-decoration”: X is not a “text-decoration” value.

About This CSS Issue

text-decoration only draws lines on text, so it rejects values like italic or bold that change the font itself.

The property is a shorthand for four others: text-decoration-line (underline, overline, line-through or none), text-decoration-style (solid, double, dotted, dashed or wavy), text-decoration-color and text-decoration-thickness. Every word in the value has to belong to one of them. The validator names only the first word that doesn't, so text-decoration: underline bold italic gets reported for bold.

Italic text comes from font-style: italic, and bold text from font-weight: bold. Misspelled keywords trigger the same error: CSS has no underlined or strikethrough, only underline and line-through.

Browsers ignore the whole declaration when any word in it is invalid. With text-decoration: underline italic, the text gets neither the underline nor the italics.

When the italics mean something, use an element instead of a style attribute: <em> for stress emphasis, <i> for a term from another language. Both render in italics by default.

Invalid example

<p>
  <span style="text-decoration: italic;">Office closed on public holidays.</span>
</p>

Valid example

<p>
  <span style="font-style: italic;">Office closed on public holidays.</span>
</p>

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?
🌍 Trusted by teams worldwide

Validate at scale.
Ship accessible websites, faster.

Automated HTML & accessibility validation for large sites. Check thousands of pages against WCAG guidelines and W3C standards in minutes, not days.

Scheduled Reports
API Access
Open Source Standards
€5 / week

1K Weekly

1,000 monthly checks. Cancel anytime.

Get 1K Weekly →

Join teams across 40+ countries