# CSS: “padding-left”: X negative values are not allowed.

> Canonical HTML version: https://rocketvalidator.com/html-validation/css-padding-left-x-negative-values-are-not-allowed
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

A `padding-left` declaration has a negative value, and padding can't be less than zero.

Left padding is the space between an element's left border and its content, so CSS only accepts zero or a positive length or percentage for it. A browser drops a `padding-left` declaration with a negative value, and the element keeps whatever left padding it gets from other rules. On a list, that means the default indentation stays where it was.

To fix the error, change the value to `0` or a positive length. Setting `padding-left: 0` removes the indentation a list gets by default. If the content has to move past the left edge of its container, use a negative `margin-left`, which CSS allows. The `padding` shorthand and the other side properties follow the same rule, and each one has its own message.

## Invalid example

```html
<ul class="links" style="padding-left: -20px;">
  <li>First link</li>
  <li>Second link</li>
</ul>
```

## Valid example

```html
<ul class="links" style="padding-left: 0;">
  <li>First link</li>
  <li>Second link</li>
</ul>
```
