Hello, I hope everyone is doing well! Currently, I love how the main image banner, on my homepage, looks on the desktop screen, however, on mobile screens it isn’t width enough so you can’t see the end sides (right and left) of the image. I’ll appreciate any suggestion on how to fix this issue. Thanks in advance!
Topic summary
A user’s homepage banner image displays correctly on desktop but crops the left and right edges on mobile devices, making parts of the image invisible.
Solution Provided:
Two community members offered CSS fixes to resolve the mobile display issue:
-
Method 1: Add custom CSS through Online Store → Customize → Settings → Custom CSS, targeting the banner media with
object-fit: containandheight: autoproperties for screens under 749px width. -
Method 2: Edit the theme’s
base.cssfile directly by adding similar CSS rules with amin-height: 19remspecification for the banner content.
Outcome:
The original poster confirmed the solution worked successfully. Both approaches use media queries to adjust how the banner image scales on mobile screens, ensuring the full image remains visible without cropping.
Go to your online store → customize → settings → custom css and paste this code there
@media screen and (max-width: 749px) {
.banner--medium:not(.banner--mobile-bottom):not(.banner--adapt) .banner__content {
min-height: 16rem !important;
}
div.slideshow__media.banner__media.media img {
height: auto !important;
object-fit: contain;
}
}
Thank you so much! It worked!
Hi @Patwalters ,
I have reviewed your requirement, you just need to edit css script and the issue will be resolved. You can follow my instructions!
Step 1: Go to Admin → Online store → Theme > Edit code:
Step 2: Search for the file base.css. And add this code snippet to the end of the file.
@media screen and (max-width: 749px) {
.slideshow__media.banner__media.media img {
object-fit: contain !important;
height: auto !important;
}
.banner--medium:not(.banner--mobile-bottom):not(.banner--adapt) .banner__content {
min-height: 19rem !important;
}
}
Step 3: Save your code and reload this page.
=>> The result:
I hope these instructions will help you. If they are helpful, please give us likes and mark as the solution.
Have a nice day sir!
Glad it worked for you



