How can I eliminate extra header space on a product page?

Topic summary

A user seeks to remove excess white space in the header on product pages for their Shopify store using the Stiletto theme. They want the header to appear more compact without activating the transparent header option, which would alter logo and icon colors.

Desired outcome:

  • Eliminate the white space above the header on product pages only
  • Maintain current logo and icon styling
  • Create a cleaner, more streamlined appearance

Solution provided:
A community member offered CSS code to address the issue:

  • Navigate to Shopify admin → Online Store → Themes → Edit code
  • Locate the CSS file (base.css, style.css, or theme.css) in the Assets folder
  • Add custom CSS targeting header row elements and logo margins
  • The code sets specific height constraints and removes top/bottom margins

Status: The solution appears complete with step-by-step implementation instructions and visual confirmation of the expected result. The user was advised to mark the helpful response as the solution.

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

Hello!

I would like to remove the extra white space in the header on the product page. Basically convert it to a “transparent header” (only on the product page) but without changing the colors of the logo and icons as would happen if I activate the transparent header option.

My website is https://winnerofficial.com/products/product-18-jacket-1, my theme is Stiletto and my password is y21

I attach reference photos:

  • How my product page looks now (the red lines represent the part I want to remove):

On mobile:

On Desktop:

-How I would like it to look:

On mobile:

On desktop:

HI @martujv

Check this one.

From your Shopify admin dashboard, click on “Online Store” and then “Themes”.

Find the theme that you want to edit and click on “Actions” and then “Edit code”.

In the “Assets” folder, click on “base.css, style.css or theme.css” file, depending on which file your theme uses to store its CSS styles. At the bottom of the file, add the following CSS code:

span.header__logo {
    margin-top: 0px;
    margin-bottom: 0px;
}
.header__row-segment.header__row-segment-desktop.left.contains-nav {
    height: 50px;
}
.header__row.header__row-mobile {
    min-height: 50px;
}

And Save.

Result:

Please don’t forget to Like and Mark Solution to the post that helped you. Thanks!

1 Like