When you’re seeing z-index issues with a sticky header that work in Chrome but break in Safari/iOS Safari, it's usually due to Safari handling position: sticky
and stacking contexts differently than Chrome.
1. Understand the Safari Sticky Behavior
- Safari often treats elements with
position: sticky
as creating a new stacking context. - In Safari, even if you have a high z-index on the sticky element, it can get trapped inside its parent’s stacking context if that parent has specific styles (like
transform
, opacity < 1
, filters
, will-change
, etc.).
2. Check Parent Elements for Stacking Context Triggers
- Review all the parent containers of your sticky header inside Webflow.
- Make sure no parent has CSS properties like:
- transform (even
transform: none
can trigger a new stacking context) - opacity (less than 1)
- will-change (property optimizations)
- filter (like blur, grayscale, etc.)
- perspective, clip-path, mask, or contain
3. Fix by Removing or Adjusting Problematic Properties
- Remove or reset these properties on parent containers if possible.
- If
transform
is needed for animations or layout, apply it carefully and test. - You can alternatively move the sticky element outside of problematic parents, higher up in the DOM hierarchy.
4. Set a Proper Z-Index and Confirm Position
- Select the sticky header in Webflow and ensure:
- Position is set to Sticky and anchored to the top (Top: 0px).
- Z-index is very high (for example, 9999) to dominate other elements.
- Also check that sibling elements don’t unintentionally have a higher z-index.
5. Use Webflow Designer Best Practices
- Use the Navigator panel to restructure the DOM hierarchy if necessary.
- Set z-indexes intentionally across sections—not too high everywhere, but consistently layered (e.g., navbar at 1000, modal at 2000, etc.).
Summary
Safari's different handling of position: sticky usually causes sticky header z-index issues if a parent creates a stacking context. Audit parent elements by removing styles like transform
, set a high z-index on the sticky header, and restructure the DOM if necessary in Webflow to resolve the Safari-specific bugs.