Announcement Bar Overlays Header

Topic summary

A user encountered a z-index layering issue where the announcement bar appeared in front of the header when scrolling on both mobile and desktop versions of their Shopify store using the Stiletto theme.

Solutions Provided:

Three different approaches were offered to fix the layering problem:

  • Solution 1: Add custom JavaScript code to theme.liquid file above the </body> tag to dynamically adjust z-index values
  • Solution 2: Insert CSS code (z-index: 511 !important) targeting the header section through the theme customizer’s Custom CSS area
  • Solution 3: Add CSS styling to theme.liquid before the </head> tag to control header z-index

Resolution:

The issue was successfully resolved. The user confirmed one of the solutions worked, though they didn’t specify which approach they implemented. All solutions included visual examples showing the corrected header layering.

Summarized with AI on November 2. AI used: claude-sonnet-4-5-20250929.

Hey folks!

The announcement bar is in front of my header every time I scroll past it (both in mobile and desktop):

How can I place the header in front of the announcement bar?

My theme is Stiletto and my website is: https://vsa0oqnbhrloapy0-60150284501.shopifypreview.com

I would really appreciate some help

2 Likes

Hey @martujv

Follow these Steps:

  1. Go to Online Store

  2. Edit Code

  3. Find theme.liquid file

  4. Add the following code in the bottom of the file above tag


RESULT:

If I managed to help you then, don’t forget to Like it and Mark it as Solution!

Best Regards,
Moeed

1 Like

Hi @martujv

You can solve it by adding this code to Custom CSS in Online Store > Themes > Customize > Theme settings

#shopify-section-sections--24317362667859__header { z-index: 511 !important; }
1 Like
  • Here is the solution for you @martujv
  • Please follow these steps:
  1. Go to Online Store → Theme → Edit code.
  2. Open your theme.liquid file
  3. In theme.liquid, paste the below code before and press ‘Save’ to save it

  • This is the result you will get:

  • Please press ‘Like’ and mark it as ‘Solution’ if you find it helpful. Thank you.
1 Like

It worked! Thank you!

1 Like