I am trying to reformat my mobile hero image banner to show the full image (horizontal, like 16:9) instead of being the same height as desktop or whatever it is as default. I tried looking at other posts but didn’t find a working solution. I would think that I can change the code here in hero.liquid, probably the media-screen and min-width line, but I’m not sure what to add so that the hero image looks how i want it to. I am using the Horizon theme.
Hello @tannie
On mobile, the hero image height in Horizon is usually controlled by a fixed min-height or aspect-ratio, not the min-width media query itself.
To show the full image on mobile (closer to 16:9), you’ll want to override the hero container styles only for small screens.
You can try something like this in your theme CSS:
screen and (max-width: 749px) {
.hero__container {
min-height: auto;
aspect-ratio: 16 / 9;
}
.hero__container img {
object-fit: contain;
}
}
Key points:
aspect-ratio controls the banner shape on mobile
object-fit: contain prevents cropping
Keeping this inside a mobile media query avoids affecting desktop
If the theme sets height inline, you may also need to remove or override that specific rule. This approach usually works without editing hero.liquid directly.