Add padding to left and right for mobile view

Topic summary

A user encountered missing left and right padding on product pages in their Shopify store’s mobile view and sought a CSS solution applicable to all product pages.

Multiple solutions were provided:

  • Add CSS targeting .product__info-wrapper.grid__item or .animate--slide-in .trigger with padding: 25px !important to the base.css file
  • Insert CSS code in theme.liquid file before the </head> or </body> tag
  • Apply media query targeting .product.grid with padding: 0 2rem for screens with minimum width of 768px

Resolution:
The issue was successfully resolved. The user confirmed one of the solutions worked perfectly and thanked the contributors.

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

Hi,

Somehow there isn’t any padding for my product pages - I’d like padding on left and right, could somebody advice what to modify? Attached link is for one product page but this change should apply to all product pages, thank you!

https://www.wastd.world/products/multi-purpose-serving-platter

Hello @letsgetwasted
Go to online store ---------> themes --------------> actions ------> edit code------->base.css
at the end of the file and save.

.product__info-wrapper.grid__item.scroll-trigger.animate--slide-in {
padding: 25px !important;
}

result

If this was helpful, hit the like button and accept the solution.
Thanks

1 Like

Hi @letsgetwasted Please add the below code:


Please follow the steps:

  1. Login in shopify admin.
  2. Click on the Online Store.
  3. Then click on the button next to Customize in live Theme.
  4. Click Edit Code.
  5. Search theme.liquid in the code in left hand side in your theme.
  6. Add the following code in the bottom of the file above tag

Result:

Hopefully it will help you. If yes then Please don’t forget hit Like and Mark it as solution!

Best Regards

Sahil

Hi @letsgetwasted ,

  1. Go to Online Store → Theme → Edit code.
  2. Open your theme.liquid file
  3. In theme.liquid, paste the below code before

If my reply is helpful, kindly click like and mark it as an accepted solution.

Thanks!

Hello @letsgetwasted ,

You can try this code; it will be helpful to you.

Go to the Online Store->Theme->Edit code->Assets->base.css>add this code at the bottom of the file.

@media only screen and (min-width: 768px) {
.product.grid {
    padding: 0 2rem;
}
}

This worked perfectly, thank you!

Happy to help you…!!!