Shrink Those Pesky Mobile Gaps in Your Shopify Dawn Theme Image Banners
Hey everyone! As a Shopify expert who spends a lot of time digging through community discussions, I often see recurring themes. One common head-scratcher that popped up recently, thanks to a great question from Tammy_29, was about those stubborn gaps in image banners on mobile. You know the ones – you've set your padding to zero, but there are still these annoying spaces between your banner image, text, and call-to-action button, especially on phones.
Tammy shared an image of her Dawn theme banner on mobile, showing exactly this issue. Despite setting the padding to 0, she noticed a significant gap between the image and the text, and another one between the text and the button label. It's a classic responsive design challenge, and it really highlights how important it is to fine-tune your mobile experience. After all, most of your customers are probably browsing on their phones!
Why "Padding: 0" Isn't Always Enough
It's easy to assume that if you set a section's padding to zero, everything inside will just snuggle up. But as Milomir (ten12star) hinted in the thread, sometimes these gaps come from "inner padding" or margins on specific elements within the banner itself, not the main section. Themes like Dawn are built with a lot of default spacing to look good out-of-the-box, but this can sometimes work against your specific design choices, especially when images are sized differently.
The good news is, the community came through with some fantastic, actionable solutions. Let's break down the best approaches.
Solution 1: Targeted Custom CSS in Your Theme Editor (The Easy Way)
Ploqo offered a super clean and straightforward method that I often recommend because it keeps your changes contained and doesn't mess with core theme files. This approach uses the "Custom CSS" feature available for individual sections within the Shopify theme editor. It specifically targets mobile views, so your desktop layout remains untouched.
Step-by-Step Guide for Dawn Theme:
- From your Shopify admin, go to Online Store > Themes.
- Find your current theme (likely Dawn) and click on Customize (or Edit theme as Ploqo mentioned, which leads to the customizer).

- In the left sidebar of the theme editor, click on the Image banner section you want to adjust.

- Scroll all the way down the settings for that section until you find and expand Custom CSS.

- Paste the following code into the Custom CSS box:
@media screen and (max-width: 749px) { .banner__box { padding-top: 1rem; padding-bottom: 1.5rem; } }
- Click Save.

This code specifically targets the .banner__box class (which is often responsible for the content area within your banner) and adjusts its top and bottom padding. The @media screen and (max-width: 749px) part ensures these changes only apply to screens 749 pixels wide or smaller, effectively targeting mobile devices. You can tweak 1rem (gap above content) and 1.5rem (gap below content/button) to values like 0.5rem or even 0 if you want it super tight.
Here's a visual of the kind of improvement you can expect on mobile:
Solution 2: More Comprehensive CSS in theme.liquid (For Deeper Control)
Mustafa_Ali provided another excellent solution that offers a bit more control by targeting both .banner__box and .banner__content. This method involves editing your theme's core files, specifically theme.liquid. While effective, always remember to duplicate your theme before making any direct code edits!
Step-by-Step Guide for Dawn Theme:
- From your Shopify admin, go to Online Store > Themes.
- Find your current theme, click the "..." (three dots) button, and select Edit code.
- In the left sidebar, find and click on
theme.liquidunder the "Layout" directory. - Scroll down to the very bottom of the file, just before the