Need help in reducing the right margin on product page.

Solved

Need help in reducing the right margin on product page.

TJ2022
Tourist
6 0 1

Need help in reducing the right margin on product page. Settings are fine. I think I need to change some code. Can you guys help. PFA. Thanks!

Screenshot 2025-04-17 at 12.39.50 PM.png

Screenshot 2025-04-17 at 12.37.32 PM.png

  

Accepted Solution (1)

Dan-From-Ryviu
Shopify Partner
11700 2293 2475

This is an accepted solution.

Hi @TJ2022 

Please open your section-main-product.css, find this code 

  .product__info-container {
    max-width: 60rem;
  }

Change 60rem in the code to 100% and save your file

Screenshot 2025-04-18 at 14.30.36.png

Screenshot 2025-04-18 at 14.32.10.png

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Amazon Products Importer - Import Amazon Products to Dropship in Your Store!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

View solution in original post

Replies 9 (9)

rajweb
Shopify Partner
822 71 155

Hey @TJ2022 ,

Welcome to the Shopify Community!

Thanks for the screenshot and the code! Based on the image and your CSS snippet, it looks like there's unnecessary right spacing (probably due to padding or margin applied by the theme layout or container classes).

Here’s how we can debug and fix it:

Try This CSS Override:

- Add the following to your theme’s custom CSS area (Online Store > Themes > Customize > Theme settings > Custom CSS) or inside your base.css or theme.css:

#shopify-section-template--17886088659122__main .page-width,
#shopify-section-template--17886088659122__main .product__info-wrapper {
    padding-right: 0 !important;
    margin-right: 0 !important;
    max-width: 100% !important;
}

If your theme uses a grid layout like grid--1-col, you might also need:

#shopify-section-template--17886088659122__main .grid {
    gap: 0 !important;
}

Mobile Consideration (Optional)

To ensure responsiveness, wrap overrides in media queries if needed:

@media (min-width: 768px) {
  #shopify-section-template--17886088659122__main .product__info-wrapper {
    max-width: 100%;
  }
}

 

Best Regards,

Rajat

Shopify Expert

Rajat | Shopify Expert Developer
Need a reliable Shopify developer for your next project?
Our App: Productify Groups App
Email: rajat.shopify@gmail.com
Portfolio: https://rajatweb.dev

Bundler-Manuel
Astronaut
1012 51 118

Hello there TJ @TJ2022  Here are the steps you should take in solving this issue.

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

Step 2: Search file base.css

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


slider-component.slider-mobile-gutter.page-width.page-width-desktop {

    padding: 0 !important;

}

 

Let me know if this works for you!

Emmanuel
Please let me know if it works by marking it as a solution!
Bundler - Product Bundles app, a great bundle app for Shopify, with glowing user testimonials and a free plan.

Dan-From-Ryviu
Shopify Partner
11700 2293 2475

This is an accepted solution.

Hi @TJ2022 

Please open your section-main-product.css, find this code 

  .product__info-container {
    max-width: 60rem;
  }

Change 60rem in the code to 100% and save your file

Screenshot 2025-04-18 at 14.30.36.png

Screenshot 2025-04-18 at 14.32.10.png

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Amazon Products Importer - Import Amazon Products to Dropship in Your Store!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

TJ2022
Tourist
6 0 1

Thanks a lot, I tried it and it worked 

TJ2022
Tourist
6 0 1

and can you also help in removing the background color behind add to cart. 

Screenshot 2025-04-19 at 12.32.59 PM.png

Dan-From-Ryviu
Shopify Partner
11700 2293 2475

Please use this code

.product__title h1 { font-size: 22px !important; }
.product-form__submit span { background-color: transparent !important; }

- Helpful? Like & Accept solution!
- Ryviu - Product Reviews & QA app: Import reviews from AliExpress, Amazon, Etsy, Walmart, Dhgate and CSV.
- Amazon Products Importer - Import Amazon Products to Dropship in Your Store!
- Lookfy Gallery: Lookbook Image - Gain customers with photo gallery, video & shoppable image
- Reelfy‑Shoppable Videos+Reels: Create shoppable videos to engage customers and drive more sales.
- En...
Sign up now.

TJ2022
Tourist
6 0 1

can you also tell me how to reduce the size of the title of the product?

namphan
Shopify Partner
2690 349 399

Hi @TJ2022,

Please go to Customize > Sections > Image with text > Custom CSS > Add code:

@media screen and (min-width: 750px) {
.image-with-text__content {
    padding-right: 0;
}
}
Coffee tips fuels my dedication.
Shopify Development Service
PageFly Page Builder Optimize your Shopify store (Free plan available)
Need help with your store? namphan992@gmail.com

StrokeInfotech
Shopify Partner
5 0 1

Hi @TJ2022  👋,

Absolutely! If your theme settings look fine but you're still seeing a large right margin on the product page, the issue might be caused by a max-width restriction on the container element.

Here’s how you can fix it:

Step 1 :- Go to your Shopify Admin.

Step 2 :- Navigate to Online Store > Themes.

Step 3 :- Click “Edit code” on your active theme.

Step 4 :- In the Assets folder, open the file named section-main-product.css (or similar, depending on your theme).

Step 5 :- Search for this CSS class:

.product__info-container {
  max-width: 60rem;
}

If the max-width is set to a smaller value like 60rem, it could be limiting the content width and visually creating that extra margin. Try updating it to:

.product__info-container {
  max-width: 100%;
}

This change will allow the container to use the full available width, which should help eliminate the unwanted space on the right side.

Step 6 :- Save the changes and refresh your product page to see the update.

Let me know if you need further assistance!

Stroke Infotech | Top-Rated Shopify Agency


If our suggestion works for you, please give it a Like or mark it as a Solution!


Should you have any questions or concerns, feel free to contact us via info@strokeinfotech.com