# CSS: “border”: X negative values are not allowed.

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

Negative values for the CSS `border` property (specifically `border-width`) are not valid and will be rejected by browsers.

The `border-width` property only accepts non-negative length values (like `1px`, `0.5em`) or keyword values (`thin`, `medium`, `thick`). A negative value such as `-1px` doesn't make sense for a border since you can't have a border with negative thickness.

This error often appears when using inline styles or embedded `<style>` blocks. It can result from a typo, a calculation error, or a misunderstanding of how border works.

If you're trying to remove a border, use `border: none` or `border-width: 0` instead of a negative value.

## Incorrect Example

```html
<div style="border: -1px solid black;">
  This has an invalid negative border width.
</div>
```

## Correct Example

```html
<!-- Using a valid positive border width -->
<div style="border: 1px solid black;">
  This has a valid border.
</div>

<!-- Removing the border entirely -->
<div style="border: none;">
  This has no border.
</div>
```
