Hello. How to remove the border so that it looks like the first photo
Topic summary
A user seeks help removing borders from product images on their Shopify store to match a desired appearance shown in reference screenshots.
Initial Solution Provided:
- Add CSS code to
base.css,style.css, ortheme.cssin the Assets folder - Code targets
.product-media-container.constrain-height.fit-contain-mediawithwidth: 100%property
Follow-up Issue:
After implementing the first solution, an upper border remains visible on mobile screens (shown in second screenshot).
Additional Fix:
A mobile-specific CSS solution was provided:
- Uses media query for screens max-width 749px
- Targets
.section-template--23175415890247__main-paddingwithpadding-top: 0
Status: The discussion appears ongoing, awaiting confirmation if the mobile border fix resolves the remaining issue. Both solutions involve adding CSS code snippets to the theme files through Shopify’s admin dashboard.
Hi @Alex31
Pease, share store URL. Thanks!
Thankks for the info, 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:
.product-media-container.constrain-height.media-fit-contain {
width: 100% !important;
}
- And Save.
- Result:
Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!
This is only for the mobile screen right? Please, add this code where you paste it. Thanks.
@media only screen and (max-width: 749px){
.section-template--23175415890247__main-padding {
padding-top: 0;
}
}
And Save.
Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!



