Grandma Marni’s mango crate is sold out: write the CSS that hides crate B, and the browser answers six questions: whether it keeps its room, shows, takes Mrs…
Picking the wrong way to hide is a real bug: a transparent button that still catches clicks, an invisible link Tab still lands on (keyboard users get lost), a layout that jumps, or a screen reader label that vanishes too. You need to know what stays alive with each one.
Hiding is four separate questions: space, paint, pointer, focus
opacity: 0 is not a way to disable. pointer-events: none only turns off the mouse; Tab still stops there. Add visibility: hidden (it transitions), use the inert attribute, or display: none.display: none jumps with no transition A display: none element has no box, so other transitions on it do not run. Animate opacity + visibility, or in modern browsers use transition-behavior: allow-discrete on display plus @starting-style for the way in.display: none and visibility: hidden take it out of the accessibility tree too. For a screen-reader-only label, use the .sr-only pattern: position: absolute, 1px, overflow: hidden, clip-path: inset(50%).visibility: hidden A and C stay put: B’s room is kept. A tap at B’s spot goes through to the table, and Tab does not stop there.opacity: 0, then tap B’s spot B’s tap counter goes up although B is invisible. That is the most common trap.opacity: 0: press Tab from crate A, or run the focus test Focus lands on the invisible B. A keyboard user has no idea where they are.