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

> Canonical HTML version: https://rocketvalidator.com/html-validation/css-visibility-x-is-not-a-visibility-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 `visibility` property inside your HTML document.

The `visibility` property controls whether an element is visually displayed without affecting the document layout. Unlike `display: none`, a hidden element still occupies space on the page.

The accepted values for `visibility` are:

- `visible` — the element is shown (default).
- `hidden` — the element is invisible but still takes up space.
- `collapse` — used primarily with table rows and columns to remove them without affecting the table layout. On non-table elements, it behaves like `hidden`.

This error typically occurs when you use a value meant for a different property, such as `none` (which belongs to `display`), or a misspelled value like `hiden` or `visble`.

## Invalid Example

```html
<p style="visibility: none;">This text is hidden.</p>
```

The value `none` is not valid for `visibility`. You likely meant `hidden` or intended to use the `display` property instead.

## Fixed Example

Using the correct `visibility` value:

```html
<p style="visibility: hidden;">This text is hidden but still takes up space.</p>
```

Or, if you want the element to be fully removed from the layout, use `display` instead:

```html
<p style="display: none;">This text is completely removed from the layout.</p>
```
