Get to know MDN better
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The visibility CSS property shows or hides an element without changing the layout of a document. The property can also hide rows or columns in a <table>.
To both hide an element and remove it from the document layout, set the display property to none instead of using visibility.
The visibility property is specified as one of the keyword values listed below.
The element box is visible.
hiddenThe element box is invisible (not drawn), but still affects layout as normal. Descendants of the element will be visible if they have visibility set to visible. The element cannot receive focus (such as when navigating through tab indexes).
collapseThe collapse keyword has different effects for different elements:
Using a visibility value of hidden on an element will remove it from the accessibility tree. This will cause the element and all its descendant elements to no longer be announced by screen reading technology.
When animated, visibility values are interpolated between visible and not-visible. One of the start or ending values must therefore be visible or no interpolation can happen. The value is interpolated as a discrete step, where values of the easing function between 0 and 1 map to visible and other values of the easing function (which occur only at the start/end of the transition or as a result of cubic-bezier() functions with y values outside of [0, 1]) map to the closer endpoint.
| visible |
| all elements |
| yes |
| as specified |
| discrete |
| CSS Display Module Level 3 # visibility |
| Scalable Vector Graphics (SVG) 2 # VisibilityControl |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Apr 20, 2026 by MDN contributors.
Your blueprint for a better internet.
Visit Mozilla Corporation’s not-for-profit parent, the Mozilla Foundation.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.