My Image Banner for desktop looks great but in the mobile version it cuts it off majorly. I’ve tried codes found in other discussions but they did not work for me. Website is www.silverandash.co to view the issue.
Thanks for any help!
Mobile banner image in the Dawn theme is being cropped on phones, while the desktop version looks fine. The store owner tried prior code fixes without success.
Proposed fix 1: Edit theme.liquid and add custom code (placed above ). The shared result shows the image letterboxed with large gray bars on mobile, which the owner does not want. Screenshots were provided to illustrate the outcome.
Proposed fix 2: Add CSS to the theme’s CSS file: .banner__media img { object-fit: contain !important; } and remove overlay backgrounds. This preserves the full image but still introduces empty space (gray bars), so it doesn’t meet the owner’s goal.
Technical note: object-fit: contain shows the entire image but adds bars when the image aspect ratio doesn’t match the container; object-fit: cover fills the container but crops the image.
Status: Unresolved. The owner seeks a way to display the full image on mobile without gray bars; no agreed solution or action items yet.
My Image Banner for desktop looks great but in the mobile version it cuts it off majorly. I’ve tried codes found in other discussions but they did not work for me. Website is www.silverandash.co to view the issue.
Thanks for any help!
Hey @silverandashco
Follow these Steps:
Go to Online Store
Edit Code
Find theme.liquid file
Add the following code in the bottom of the file above tag
RESULT:
If I managed to help you then, don’t forget to Like it and Mark it as Solution!
Best Regards,
Moeed
Thanks Moeed - the problem is I don’t want those big gray bars involved. Is there a way to fix that?
Try this one.
.banner__media img {
object-fit: contain !important;
}
.banner:after, .banner__media:after {
background: transparent !important;
}
Your Feedback Matters! Please mark the solution and give likes to posts that helped you. Your appreciation fuels our motivation to assist you better!
Thank you for your response! However, it’s still not the full image so not what I’m looking for. Any way to still get the full image with no gray bars?