Sticky announcement bar is covering sticky header on scroll

Topic summary

A user implemented CSS to make their announcement bar sticky but encountered an issue where it overlaps the sticky header on scroll.

Problem Details:

  • Added position: sticky; top: 0; to .announcement-bar-section
  • The sticky announcement bar now covers the transparent header when scrolling
  • Site is on Shopify (password-protected store provided)

Proposed Solutions:

Two community members offered CSS fixes:

  1. First approach: Add margin-top to the header element in base.css:

    • Targets the specific header class
    • Adds margin-top: 42px !important;
    • Includes before/after screenshots showing the fix
  2. Second approach: Adjust the header’s top position via Custom CSS:

    • Add .shopify-section-header-sticky { top: 43px !important; }
    • Applied through Theme settings > Custom CSS
    • Includes screenshot of where to add the code

Both solutions push the header down to prevent overlap with the sticky announcement bar. The issue remains unresolved as the original poster hasn’t confirmed which solution worked.

Summarized with AI on October 28. AI used: claude-sonnet-4-5-20250929.

Hi there,

I added the following code to make the announcement bar sticky-

.announcement-bar-section {
  position: sticky;
  top: 0;
}

But now when the announcement bar is sticky it is covering the sticky header which transparent(not transparent on scroll)

Website - https://www.valcoure.store/

Password - kothavara

Thank You

1 Like

Hi @AnSrSi

You can try to follow this step
Step 1: Go to Edit code
Step 2: Find file base.css and add this code at the end of the file

header.header.header--middle-center.header--mobile-center.page-width.header--has-menu.header--has-account {
    margin-top: 42px !important;
}

Result

Best,

DaisyVo

1 Like

Please add this code to Custom CSS in Sales channels > Online store > Themes > Customize > Theme settings.

.shopify-section-header-sticky { top: 43px !important; }

2 Likes