Taming Your Shopify Hero Banner: Desktop Height Control Without the Headaches

Hey there, fellow store owners! Ever found yourself wrestling with your Shopify theme, trying to get that perfect hero banner look on desktop without messing up your mobile experience? You're definitely not alone. It's a super common challenge, and it recently popped up in a community discussion that I think many of you will find incredibly helpful.

Our friend JustPrecuts, running a store on the Dawn 15.4.1 theme, came to the community with exactly this dilemma. They wanted to adjust their hero banner's height specifically for desktop viewers, while keeping it just right for mobile. What made their situation particularly frustrating was that even AI and Shopify's live agents hadn't been able to crack it. Sound familiar? We've all been there, bouncing between different solutions trying to find the one that sticks.

Initially, Moeed, another helpful community member, reached out to ask for JustPrecuts's store URL to get a better look, which JustPrecuts promptly provided: www.justprecuts.com.au. This kind of collaboration is what makes the Shopify community so powerful!

Meanwhile, sadik_ShopiDevs jumped in with a detailed code snippet, suggesting a direct edit to the sections/image-banner.liquid file. Now, for the more technically inclined, this approach offers a lot of precision, using a section.id to target specific banners and even handling the 'Adapt to image' setting. They even included a smart media query to ensure the changes only applied to screens 750px and wider, keeping mobile untouched.

Here’s the code sadik_ShopiDevs shared, which you’d place immediately before the {% schema %} tag in your sections/image-banner.liquid file:

{% 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 %}

While this is a robust solution for developers, JustPrecuts reported that it "sadly no change to desktop" for their specific setup. This highlights that sometimes, even technically sound code might need a slightly different angle depending on theme variations or other customizations. Sadik_ShopiDevs also wisely recommended duplicating your theme before any code edits – a golden rule we should all live by!

For those looking for more advanced, no-code solutions for responsive sliders and animated sections, sadik_ShopiDevs also pointed towards apps like Slider Revolution & Sections. It’s always good to know there are drag-and-drop options available if diving into code isn't your thing, or if your banner needs are super complex.

But the community didn't stop there! After JustPrecuts confirmed the initial solution didn't work, Moeed, leveraging the store URL he'd previously requested, came back with a solution that really hit the mark. This approach is fantastic because it leverages Shopify's built-in 'Custom CSS' feature, making it much safer and easier for most store owners to implement without directly editing core theme files.

Moeed's insight was to target the .banner class specifically for desktop views. This is where the magic happens, and it's a great example of how a simple, well-placed CSS snippet can solve a seemingly stubborn problem.

Implementing the Desktop Banner Height Fix

If you're facing a similar challenge with your hero banner, here's how you can implement Moeed's solution:

  1. Duplicate Your Theme (Seriously, Do It!): Before making ANY changes, go to your Shopify Admin -> Online Store -> Themes. Find your current theme, click 'Actions' -> 'Duplicate'. This creates a safe backup you can revert to if anything goes awry.
  2. Navigate to Theme Customizer: From your Shopify Admin, go to Online Store -> Themes. Click 'Customize' on your active theme.
  3. Select Your Hero Banner Section: In the theme customizer, click on the hero banner section you want to modify.
  4. Find the 'Custom CSS' Option: Scroll down the sidebar settings for that banner section. You should see a field labeled 'Custom CSS' or 'Custom Liquid'. This is where you'll paste your code.
  5. Add the CSS Code: Copy and paste the following code into the 'Custom CSS' box:
  6. @media screen and (min-width: 768px) {
    .banner {
        height: 90% !important;
    }
    }
  7. Adjust the Height: The 90% value is your key. You can increase or decrease this percentage to get your desired desktop banner height. Moeed specifically noted that this will only affect your desktop version, which is exactly what JustPrecuts needed!
  8. Save Your Changes: Don't forget to hit the 'Save' button in the top right corner of the theme customizer.

Moeed even shared a helpful screenshot showing the result, which always gives you that extra confidence:

Laza_Binaery also chimed in with a similar CSS snippet, suggesting targeting .banner .banner__media and offered some excellent design advice. They pointed out that if you have a lot of text on your banner image, it might be tough to get the height just right without cropping important parts. Their suggestion to use an alternative image with a clean left side for text, or to add a clear call-to-action button, is spot on. And honestly, making the whole image clickable is often a smart move – customers will try to click it!

This discussion is a fantastic example of the power of the Shopify community. When you hit a roadblock, chances are someone else has faced it too, or has a brilliant workaround. Moeed's solution for controlling hero banner height on desktop, specifically for Dawn theme users, is a simple yet incredibly effective fix that avoids complex file edits. It just goes to show that sometimes, the best solutions are the most straightforward ones, found right there in the collective wisdom of fellow store owners and experts. Always remember to back up your theme, test your changes thoroughly on different devices, and don't be afraid to tweak those values until your banner looks absolutely perfect!

Share:

Use cases

Explore use cases

Agencies, store owners, enterprise — find the migration path that fits.

Explore use cases