CSS content-visibility Property

❮ Previous Reference Next ❯


.hidden {
  content-visibility: hidden;

.visible {
  content-visibility: visible;

Hello World!


The content-visibility CSS property controls whether or not an element renders its contents at all, along with forcing a strong set of containments, allowing user agents to potentially omit large swathes of layout and rendering work until it becomes needed.

It enables the user agent to skip an element's rendering work (including layout and painting) until it is needed — which makes the initial page load much faster.

Default value:visible
JavaScript syntax:

Standard Syntax

content-visibility: visible|hidden|auto|initial|inherit|revert|revert-layer|unset;

Browser Support


Property Values

The following table describes the values of this property:

Value Description
visible No effect. The element's contents are laid out and rendered as normal.
hidden The element skips its contents. The skipped contents must not be accessible to user-agent features, such as find-in-page, tab-order navigation, etc., nor be selectable or focusable. This is similar to giving the contents display: none.
auto The element turns on layout containment, style containment, and paint containment.
initial Sets this property to its default value.
inherit If specified, the associated element takes the computed value of its parent element animation-delay property.
revert Reverts the cascaded value of the property from its current value to the value the property
revert-layer Rollback styles to the ones specified in previous cascade layers.
unset Resets a property to its inherited value if the property naturally inherits from its parent, and to its initial value if not.

Default CSS Property Values

selectors {
  content-visibility: visible;
❮ Previous Reference Next ❯