When writing MDN docs for anchor positioning, I was a bit confused by position-visibility — the spec says "initial value" is anchors-visible, but surely it should be always?
From testing:
- If you don't set a
position-visibility value, an anchor-positioned element is always visible provided it is inside the viewport, regardless of the visibility of its anchor. This is the behavior always gives as well.
anchors-visible, on the other hand, causes an anchor-positioned element to be hidden if its anchor is not visible at all in the viewport.
My demo illustrates the behavior of the currently-supported values, in case that is helpful.