A Shopify store using the Dawn theme (v15.0.2) encountered a banner display issue on mobile devices. The banner wasn’t utilizing the full width of the mobile screen and had unwanted spacing.
Initial Solution Attempt:
A community member provided CSS code to be added to theme.liquid above the </body> tag
This partially resolved the width issue but left blank space between the banner and top menu
Root Cause:
The spacing issue stemmed from using a desktop-sized banner image on mobile
Recommendation was to create a separate mobile banner (~750 × 1100 px) in a dedicated section
Final Resolution:
The store owner independently developed a custom CSS solution combining the initial code with additional styling
Applied object-fit: contain, negative top margin (-65%), and background color adjustments within a mobile media query
Set banner height to “Adapt to first image” in the theme customization settings
Status: Issue resolved through custom CSS implementation.
Summarized with AI on October 28.
AI used: claude-sonnet-4-5-20250929.
We’ve noticed that the banner image of our home page is not displayed properly on the mobile version of our site. On desktop, our homepage looks like this:
We want this banner to take 100% of the width of the mobile version. Also we want to keep the desktop version undistrubed from any changes and keep it as it is. Bellow we provide an image that demonstrates how we want the mobile version of our page to look like:
Thank you for your reply. Your suggestion is close to what we want but we also need to not have any blank space between the banner and the top menu like the one that is visible on your screenshot. Do you know how can this be fixed?
This empty space is because the banner size which you’re using at the moment is for desktop, I would suggest add a separate banner for mobile somewhere around the size of 750 × 1100 px so that it looks much cleaner and fits well on mobile.
Just simply create another section in which you’re displaying the mobile image so in total there should be 2 sections, one displaying the desktop img and the other displaying the mobile img. Once that is done then just let me know and I’ll provide you the necessary code.
we found the solution on our own. With the help of @Moeed 's code, we’ve added the following just before on our theme.liquid file: @media screen and (max-width: 767px) {
.banner__media.media.animate–fixed.scroll-trigger.animate–fade-in img {
object-fit: contain !important;
margin-top: -65%;
background: #F5F4F1 !important;
}
}
and then we’ve setted “Adapt to first image” on the banner heightn field from “image banner” from “customize your store”. We would like to thank Moeed for his contributions.