# CSS: “margin-bottom”: X is not a “margin-bottom” value.

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

An invalid value was assigned to the `margin-bottom` CSS property, and the W3C validator rejected it because it does not match any accepted syntax for that property.

The `margin-bottom` property accepts a length (e.g., `10px`, `2em`), a percentage (e.g., `5%`), `auto`, or the global keywords `inherit`, `initial`, `revert`, and `unset`. The validator raises this error when the value is misspelled, uses a wrong unit, is missing a unit entirely, or contains an otherwise unrecognized token.

Common causes:

- A bare number without a unit, like `margin-bottom: 10` instead of `margin-bottom: 10px`. Zero is the only length value that does not require a unit.
- A typo in the unit or keyword, like `margin-bottom: 10 px` (with a space) or `margin-bottom: auто` (mixed character encodings).
- An invalid keyword, like `margin-bottom: none`. The `margin-bottom` property does not accept `none`.

## Example with the error

```html
<p style="margin-bottom: 10">This paragraph has an invalid margin.</p>
```

The value `10` is not valid because it lacks a unit.

## Fixed example

```html
<p style="margin-bottom: 10px">This paragraph has a valid margin.</p>
```

Adding a recognized unit like `px`, `em`, `rem`, or `%` fixes the error. If the intended value is zero, `margin-bottom: 0` is valid without a unit.
