# CSS: “padding”: X is not a “padding” value.

> Canonical HTML version: https://rocketvalidator.com/html-validation/css-padding-x-is-not-a-padding-value
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

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 `10xp` instead of `10px`.
- Omitting the unit on a non-zero value, such as `padding: 10` instead of `padding: 10px`.
- Passing a color, keyword, or other unrelated value, such as `padding: red` or `padding: 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 `style` attribute 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

```html
<div style="padding: 10xp;">Content</div>
```

### Fixed padding value

```html
<div style="padding: 10px;">Content</div>
```
