CSS position-visibility Property
The position-visibility property hides an anchor-positioned element when its anchor is hidden or when it overflows.
Description
The position-visibility property decides when an absolutely positioned element should be hidden automatically, typically an anchored tooltip or popup whose anchor has scrolled out of view. Hiding is done strongly, as with visibility: hidden, without changing the element's layout.
With anchors-visible (the default) the element is hidden when its default anchor is completely clipped, for example scrolled out of a scroll container, so labels do not float detached from the content they describe. no-overflow hides the element when it overflows its containing block even after trying all fallbacks. always never hides it.
Definition
- Initial value
- anchors-visible
- Applies to
- absolutely positioned elements
- Inherited
- no
- Computed value
- as specified
- Animatable
- discrete
- JavaScript syntax
- object.style.positionVisibility
Interactive Demo
Scroll this box until the anchor is out of view.
More content
More content
More content
More content
More content
More content
More content
More content
Syntax
position-visibility: always | [ anchors-valid || anchors-visible || no-overflow ];
Values
- alwaysThe element is always shown.
- anchors-visibleThe default. The element is hidden when its default anchor is completely hidden by clipping or scrolling.
- anchors-validThe element is hidden when any of its required anchors cannot be found.
- no-overflowThe element is hidden when it overflows its containing block after all fallback positions have been tried.
- initialSets the property to its initial value.
- inheritTakes the computed value of the parent element.
Example
Browser Support
The following information will show you the current browser support for the CSS position-visibility property. Hover over a browser icon to see the version that first introduced support for this CSS property.
Desktop





Tablets & Mobile





