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

> Canonical HTML version: https://rocketvalidator.com/html-validation/css-right-x-is-not-a-right-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 CSS `right` property, meaning the validator does not recognize the value you provided.

The CSS `right` property specifies the horizontal offset of a positioned element from the right edge of its containing block. It only accepts specific value types: a length (e.g., `10px`, `2em`), a percentage (e.g., `50%`), `auto`, `inherit`, `initial`, `unset`, or `revert`. Any other value — such as a typo, a missing unit, or an unsupported keyword — will trigger this validation error.

A common mistake is forgetting the unit after a number. In CSS, `0` is the only length value that can be written without a unit. Writing something like `right: 10` instead of `right: 10px` is invalid. Another common cause is using an unrecognized keyword or passing a value meant for a different property.

## Invalid Example

```html
<div style="position: absolute; right: 10;">
  This box has an invalid right value.
</div>
```

The value `10` is missing a unit, so the validator rejects it.

## Fixed Example

```html
<div style="position: absolute; right: 10px;">
  This box is correctly positioned.
</div>
```

Adding a valid unit like `px`, `em`, `rem`, or `%` resolves the issue. If you intended no offset, use `right: 0` or `right: auto`.
