Mastering Your Shopify Hero Banner: Desktop Height Control Without Touching Mobile

Ever found yourself staring at your Shopify store's hero banner, wishing you could just tweak its height for desktop visitors without messing up how it looks on mobile? You're definitely not alone! This is a super common design challenge, and it's exactly what a fellow store owner, JustPrecuts, recently asked about in the Shopify Community forums.

JustPrecuts was running on Dawn 15.4.1 and wanted to adjust their hero banner's height specifically for desktop, leaving the mobile view untouched. They'd even tried consulting AI and Shopify live agents without success, which really highlights how specific these CSS tweaks can be. The good news is, the community delivered some fantastic, actionable advice, and I wanted to share the best takeaways with you.

Why Hero Banner Height Matters (and Why It's Tricky)

Your hero banner is often the first thing customers see. Its height impacts how much of your product or message is 'above the fold' and sets the visual tone for your entire site. The tricky part is making it look great on a huge desktop monitor without creating a giant, empty space on a small phone screen.

The core of the solution, as several community experts pointed out, lies in using CSS and something called a 'media query.' A media query tells your browser, "Hey, only apply these styles if the screen is a certain size." This is how we target desktop without touching mobile.

Two Main Approaches from the Community

The discussion saw a couple of excellent methods emerge. Let's break them down:

Method 1: Direct Code Edit in image-banner.liquid

The first suggestion came from sadik_ShopiDevs, who provided a precise code snippet to be added directly into your theme's sections/image-banner.liquid file. This method is powerful because it targets the specific banner section by its ID, ensuring high specificity.

Important Precaution: Before you touch any theme code, always, always, duplicate your theme! This gives you a quick backup if anything goes wrong. You can do this in your Shopify admin under Online Store > Themes > Actions > Duplicate.

Here's the code sadik_ShopiDevs suggested:

{% style %}
  @media screen and (min-width: 750px) {
    #Banner-{{ section.id }} {
      height: 500px !important;
      min-height: 500px !important;
    }

    #Banner-{{ section.id }}::before,
    #Banner-{{ section.id }} .banner__media::before {
      padding-bottom: 0 !important;
    }
  }
{% endstyle %}

To implement this:

  1. In your Shopify admin, go to Online Store > Themes.
  2. Find your duplicated theme, click Actions > Edit code.
  3. Navigate to sections/image-banner.liquid.
  4. Paste the code snippet immediately before the {% schema %} tag.
  5. Replace both 500px values with your desired desktop height.
  6. Save your changes.

sadik_ShopiDevs noted that the min-width: 750px media query ensures only screens 750px and wider are affected, keeping mobile unchanged. The pseudo-element override is also key for banners set to "Adapt to image."

Method 2: Using the Theme Editor's Custom CSS (Often Easiest!)

When JustPrecuts mentioned the first solution didn't quite work for them, Moeed jumped in with another, often simpler, approach using the theme editor's built-in `Custom CSS` option. This is usually my go-to recommendation for store owners who prefer not to dive deep into theme files.

Moeed's code uses a slightly different selector and breakpoint, but achieves the same goal:

@media screen and (min-width: 768px) {
.banner {
    height: 90% !important;
}
}

Here's how to apply Moeed's solution:

  1. First, make sure you've duplicated your theme (as mentioned above!).
  2. In your Shopify admin, go to Online Store > Themes.
  3. Click Customize on your duplicated theme.
  4. In the theme editor, navigate to the Hero Banner section you want to modify.
  5. In the section settings sidebar, scroll down to find the 'Custom CSS' option (it's usually at the very bottom).
  6. Paste the code snippet into this custom CSS box.
  7. Adjust the 90% value to your preferred height. You can use percentages or pixel values (e.g., 500px) here.
  8. Click Save in the top right corner.

Moeed even shared a helpful screenshot of the result, showing how effectively this method works:

This method is generally preferred for its ease of use and because it keeps your customizations within the theme editor, making future theme updates potentially smoother.

Beyond the Code: Design Tips for Your Hero Banner

While the code fixes the height, Laza_Binaery from the community offered some really smart design advice that's worth keeping in mind:

  • Text Placement: If your banner image has a lot going on, consider an alternative image with a cleaner left side where you can place your text (title, description).
  • Call to Action: Always add a prominent button to lead customers "straight to the fun part" – your products or key collections.
  • Make it Clickable: Laza_Binaery wisely pointed out that customers often try to click on the banner itself. Consider making the entire image clickable to a relevant page. This improves user experience and can boost conversions.

Final Thoughts

Controlling your hero banner's height on desktop without impacting mobile is totally achievable with a little CSS magic. The `Custom CSS` option in your theme editor, as demonstrated by Moeed, is often the most accessible way for store owners to make these precise adjustments. Remember to always back up your theme, test your changes on different desktop screen sizes, and don't forget those crucial design considerations to make your banner truly effective.

And for those who want even more advanced control, responsive sliders, or animated sections without touching a single line of code, sadik_ShopiDevs also mentioned exploring apps like Slider Revolution & Sections. It's great to know there are options for every comfort level!

Share:

Start with the tools

Explore migration tools

See options, compare methods, and pick the path that fits your store.

Explore migration tools