Align cart icon with with Menu and get rid of the white space

Topic summary

A user needed help aligning their cart icon with the menu and removing resulting white space on their Shopify store.

Solution Provided:
A PageFly support representative offered CSS code to be added to the styles.css file:

  • Set .top-bar to position: absolute with width: 100% and margin-top: 10px
  • This initially worked but created a gap between menu and announcement bar when scrolling

Resolution:
The issue was resolved with additional CSS using a media query to adjust margin-top: 0 for the top bar at specific screen widths (max-width: 767px).

Status: Resolved - the user confirmed everything works correctly after applying the updated code.

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

Hello I would like to bring my cart down so that is aligned with my Menu and then get rid of the white space that will be left. Can someone please help me?

Here is the preview link to my store.

https://jaagfnpmd82rbw2p-55024255114.shopifypreview.com

Thanks in advance,

Hi @Only1mrsfragili

This is Henry from PageFly - Landing Page Builder App

You can try this code by following these steps:

Step 1: Go to Online Store->Theme->Edit code.

Step 2: Search file styles.css

Step 3: Paste the below code at bottom of the file → Save

.top-bar {

position: absolute !important;

width: 100% !important;

margin-top: 10px;

}

Hope that my solution works for you.

Best regards,

Henry | PageFly

1 Like

Worked perfectly! Thanks!

1 Like

Oh, sorry there is a problem with the code. When I scroll there is a gap between the menu and announcement bar.

1 Like

.top-bar {
position: absolute !important;
width: 100% !important;
margin-top: 10px;
}
@media (max-width: 767px){
.top-bar {
margin-top: 0 !important;
}
}

You can try with this code

1 Like

No everything is fine :smiley:

Thanks!

1 Like

You are welcome :blush: