About This HTML Issue
A CSS padding property contains a value the validator does not recognize as valid for that property.
The padding shorthand and its longhand variants (padding-top, padding-right, padding-bottom, padding-left) accept only <length>, <percentage>, or the keyword auto (in some contexts). Common causes of this error include:
- Using an invalid unit or misspelling a unit, such as
10xpinstead of10px. - Omitting the unit on a non-zero value, such as
padding: 10instead ofpadding: 10px. - Passing a color, keyword, or other unrelated value, such as
padding: redorpadding: bold. - Including extra or misplaced values from a copy-paste error, such as
padding: 10px 20px 30px 40px 50px(five values instead of the maximum four). - Using CSS custom properties or newer syntax in an inline
styleattribute that the validator's CSS parser does not yet support.
The padding shorthand accepts one to four values, corresponding to the top, right, bottom, and left sides. Each value must be a non-negative length (like 0, 8px, 1em, 2rem) or a percentage.
HTML examples
Invalid padding value
<div style="padding: 10xp;">Content</div>
Fixed padding value
<div style="padding: 10px;">Content</div>
Find issues like this automatically
Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.