Stacking Context

You might say

I set z-index: 9999 on the dropdown menu, so why is it still covered by a neighboring card with z-index: 2?

A browser layering boundary that groups elements together so a child's z-index only competes inside its parent group and cannot jump above a higher sibling group.When a filter bar's wrapper uses z-index: 1, transform, or opacity: 0.99, it forms a new stacking context; a dropdown inside it at z-index: 9999 still renders behind a sibling card at z-index: 2. Many visual CSS properties create stacking contexts silently, so fixing overlap means locating the boundary rather than escalating numbers.
Know first
isolation: isolate

You can say this to an AI Agent

Ready to paste into Cursor, Claude Code, or Codex
Structured AI Agent prompt

This dropdown is still covered by a sibling card despite a high `z-index`. Trace its ancestor chain for properties creating a stacking context (positioned parent with `z-index`, `transform`, `opacity < 1`, `filter`, or `backdrop-filter`) instead of increasing `z-index`. Verify the menu clears the card without covering global modals.

Want your Agent to translate plain-language UI ideas automatically?Install free VibeHub Skill →
Oil UI Pro. Push AI’s design skills to the limit. Usability, existing projects and stricter review.
Further reading