How to add margin between product image cover and header/announcement bar while scrolling?

Solved

How to add margin between product image cover and header/announcement bar while scrolling?

starscream911
Excursionist
21 0 11

Hello experts! 

 

Help me solve this case. I want to add margin between product image cover and header/announcement bar while I scroll the product description. Note that the image is sticky now in general. I just want to be simetric with a bit of margin above the image while scrolling down. Please find attached preview from now.

URL: https://www.elysiumreads.com/ 

clipboard_image_197894ca697b9519.jpg

Accepted Solutions (2)

BSSCommerce-HDL
Shopify Partner
2305 848 1065

This is an accepted solution.

Hi @starscream911

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

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

 

<style>
@media only screen and (min-width: 750px) {
    .product__column-sticky {
        top: 6.5rem !important;
    }
}
</style>

 

Here is result: 

BSSCommerceHDL_0-1725971337603.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

BSS-TekLabs
Shopify Partner
2350 702 828

This is an accepted solution.

- Here is the solution for you @starscream911 
- Please follow these steps:

z5686811214059_e66de1953f1db631f9134af5cdb796ad.jpg

- Then find the theme.liquid file.
- Then add the following code at the before tag </head> and press 'Save' to save it.

 

<style>
@media screen and (min-width: 750px) {
    .product__column-sticky {
        top: 7rem !important;
    }
}
</style>

 

- Here is the result you will achieve:

BSSTekLabs_0-1725971452299.png

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

View solution in original post

Replies 9 (9)

Huptech-Web
Shopify Partner
941 188 197

Hi @starscream911 
To add space between the top bar and image add the below CSS to base.css

 

.media>*:not(.zoom):not(.deferred-media__poster-button), .media model-viewer {
    top: 25px !important;
}
If you found this response helpful, please do like and accept the solution. Thanks!
Need support with Customizing your Shopify store?
Feel free to contact me at info@huptechweb.com or Visit our website Huptech Web.
Instant Shortcode Builder: Integrate customizable UI features anywhere in your store - No coding knowledge required
starscream911
Excursionist
21 0 11

Hello! 

Thanks for reaching out. This code doesn't work properly. It eats the top area of all my product images.

BSSCommerce-HDL
Shopify Partner
2305 848 1065

This is an accepted solution.

Hi @starscream911

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

Step 2: Search file theme.liquid

Step 3: Insert this code above </head> tag:

 

<style>
@media only screen and (min-width: 750px) {
    .product__column-sticky {
        top: 6.5rem !important;
    }
}
</style>

 

Here is result: 

BSSCommerceHDL_0-1725971337603.png

Hope this can help you,

If our suggestions are useful, please let us know by giving it a like or marking it as a solution. Thank you 😍

Sale banner, pop ups: Customize your sale banner, pop-ups and create countdown bar to boost conversion rate.
Simicart: Transform your Shopify store into a stunning and fully functional mobile app with just a few simple steps.
Product Labels & Badges:
Get more sales with striking labels, badges, and banners from our 10,000+ available templates.

BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now

starscream911
Excursionist
21 0 11

Works perfectly! 

Thank you, my friend! 

BSS-TekLabs
Shopify Partner
2350 702 828

This is an accepted solution.

- Here is the solution for you @starscream911 
- Please follow these steps:

z5686811214059_e66de1953f1db631f9134af5cdb796ad.jpg

- Then find the theme.liquid file.
- Then add the following code at the before tag </head> and press 'Save' to save it.

 

<style>
@media screen and (min-width: 750px) {
    .product__column-sticky {
        top: 7rem !important;
    }
}
</style>

 

- Here is the result you will achieve:

BSSTekLabs_0-1725971452299.png

 

- Please press 'Like' and mark it as 'Solution' if you find it helpful. Thank you.

If our suggestions are useful, please let us know by giving it a like or marking it as a solution.


Salepify: Efficiently increase sales conversion with sale-driven features like auto add to cart, free gifts (free plan available)


Salemate: Boost your AVO with 2-layer offer, countdown upsell in your post purchase page


BSS Commerce - Full-service eCommerce Agency | Use Shopify for 1$ in the first month now
starscream911
Excursionist
21 0 11

Hello! 

Works perfectly! 

 

Thank you! 

PaulMartin
Shopify Partner
596 59 140

Hi Starscream, love the name, reminds me of Transformers!

Anyway, add this Custom CSS to your section.

 

@media screen and (min-width: 750px) {
  .product__column-sticky {
    padding-top: 16px;
  }
}

 

Adjust the number to your preference and you should have a result like this:

PaulMartin_0-1725971465696.png

Hope this helped!

contact@paulmartinlopez.com
Feel free to email me! 😄
I'm open to conversations or work ʕ •ᴥ•ʔ
starscream911
Excursionist
21 0 11

Hello!

Yes, the idea is from Transformers! 😉

starscream911
Excursionist
21 0 11

Tell me!