Frontend & browser·Layout, CSS and the cascade
you set `z-index: 9999` and the element still sits behind the header.
Stacking context
A self-contained group for paint order: elements inside it are stacked among themselves, and the whole group is placed as one unit within its parent context. A `z-index` only competes with siblings in the same context, so a huge value inside a low-stacked ancestor loses to anything above that ancestor. Contexts are created by more properties than most people expect — `opacity` below 1, `transform`, `filter`, `position: fixed`, `will-change` — which is why adding a fade can break a dropdown.