Remove Image Margin Product Page

Solved

Remove Image Margin Product Page

martujv
Trailblazer
232 2 46

Hello!

 

Basically I want to remove the margins that the images have on the product page. (Only on desktop)

This is because I have the transparent header activated but there is still a gap between the header and the images on the desktop version that does not allow to see the white logo and header icons because the background is also white.

 

The margins I mean are the ones that do not allow the image section to occupy the entire screen.

It is easier to see with this images:

 

- This is how it looks right now. The red lines show the current size of the images and the blue lines show the gap on top and on the left.

Captura de pantalla 2024-07-24 a las 12.48.22.png

 

- This is how it should look: the red lines show the new limits of the image section, so it would occupy the whole screen without gaps

Captura de pantalla 2024-07-24 a las 12.49.22.png

My theme is Stiletto and my website is www.winnerofficial.com

 

I tried many codes but nothing works!

Accepted Solutions (2)

Roy-ロイ
Shopify Partner
91 19 34

This is an accepted solution.

Hi  @martujv ,

I'm happy to help you with that! You can easily achieve this by adding a simple CSS code to your theme.

To get started, follow these steps:

  1. Log in to your Shopify Admin panel.
  2. Go to Online Store > Theme > Edit code.
  3. In the code editor, navigate to the theme.css file.

Now, add the following code at the end of the file:

@media (min-width: 960px) {
  .product.is-visible {
      margin-top: 0;
  }
  
  .product__primary-right {
      margin-top: var(--spacing-10);
  }
}

Let's connect and grow your Shopify business together! 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - Connect with me at: roy.solution.partner@gmail.com ( CRO | Site Speed Optimization | Custom Development )

View solution in original post

Sweans
Shopify Partner
429 89 126

This is an accepted solution.

Hi @martujv ,

I noticed your query about removing the margin on your product page. I've inspected the page and found the solution.

Below, I've included a screenshot of the changes:

Before:

Sweans_0-1721822313197.png

 


After:

Sweans_1-1721822332563.png

 


To achieve this, you need to add the following CSS code to your stylesheet:

@media (min-width: 960px) {
.product {
margin-top: 0px;
}
}

Please check the screenshots to see the difference before and after applying the code.

Let me know if this helps or if you need any further assistance!
If it does, please like it and mark it as a solution!

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

View solution in original post

Replies 6 (6)

Roy-ロイ
Shopify Partner
91 19 34

This is an accepted solution.

Hi  @martujv ,

I'm happy to help you with that! You can easily achieve this by adding a simple CSS code to your theme.

To get started, follow these steps:

  1. Log in to your Shopify Admin panel.
  2. Go to Online Store > Theme > Edit code.
  3. In the code editor, navigate to the theme.css file.

Now, add the following code at the end of the file:

@media (min-width: 960px) {
  .product.is-visible {
      margin-top: 0;
  }
  
  .product__primary-right {
      margin-top: var(--spacing-10);
  }
}

Let's connect and grow your Shopify business together! 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - Connect with me at: roy.solution.partner@gmail.com ( CRO | Site Speed Optimization | Custom Development )

martujv
Trailblazer
232 2 46

It worked! Thank you. One more thing, is there any way to edit this same margin on mobile version?

 
Roy-ロイ
Shopify Partner
91 19 34

Definitely! Let me know what you are trying to achieve in mobile so that I can help you with the code?

 

Kind Regards, 
Roy

Let's connect and grow your Shopify business together! 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - Connect with me at: roy.solution.partner@gmail.com ( CRO | Site Speed Optimization | Custom Development )

Sweans
Shopify Partner
429 89 126

This is an accepted solution.

Hi @martujv ,

I noticed your query about removing the margin on your product page. I've inspected the page and found the solution.

Below, I've included a screenshot of the changes:

Before:

Sweans_0-1721822313197.png

 


After:

Sweans_1-1721822332563.png

 


To achieve this, you need to add the following CSS code to your stylesheet:

@media (min-width: 960px) {
.product {
margin-top: 0px;
}
}

Please check the screenshots to see the difference before and after applying the code.

Let me know if this helps or if you need any further assistance!
If it does, please like it and mark it as a solution!

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com

martujv
Trailblazer
232 2 46

It worked! Thank you. One more thing, is there any way to edit this same margin on mobile version?

Sweans
Shopify Partner
429 89 126

Hi,

I'm Happy to hear that the solution worked!

To edit the same margin on the mobile version, please remove the media query from the CSS code. The updated code should look like this:

.product {
margin-top: 0px;
}


This will ensure the margin is removed on both desktop and mobile devices.

Regards,
Sweans

- Was my reply helpful? Please Like and Accept the Solution or let me know by Buying me coffee!
- Want to modify or custom changes on store Hire me.
- Feel free to contact me at info@sweans.com regarding any help.
- To know more about me check out www.sweans.com