Banish Annoying Gaps: How to Tidy Up Space Between Your Shopify Buy Button and Product Card Border
Hey there, fellow store owners!
Ever found yourself staring at your beautiful Shopify product grid, only to be irked by a tiny, seemingly insignificant, but incredibly stubborn gap? You know the one – that awkward empty space between your "Buy Now" button and the bottom border of your product card? It’s a small detail, but these visual inconsistencies can really mess with the polished look and feel of your store. And let’s be honest, a clean, well-aligned design builds trust and encourages those all-important clicks.
Recently, we saw a great example of this very frustration pop up in the Shopify Community forums. A store owner, @xsanxdrox, was pulling their hair out trying to fix this exact issue on their store, which was running on the Horizon Theme. They’d even tried consulting AI tools like ChatGPT and Claude, but to no avail. Sound familiar? It just goes to show that sometimes, the best solutions come from real people in the community who've been there, done that.
The Annoying Gap: What It Looks Like
xsanxdrox shared a screenshot of their product grid, illustrating the problem perfectly. Take a look:

That little bit of extra padding or margin can make your product cards look uneven or less professional. It’s the kind of thing that once you see it, you can’t unsee it!
The Community-Powered Solution
Thankfully, a helpful community member named Moeed stepped in with a clear, concise solution that instantly fixed the issue. It involved a simple CSS snippet – the kind of small code tweak that can make a huge visual difference without needing to overhaul your entire theme.
The core of the fix targets the .product-grid__card class, which is responsible for the layout of individual product cards. By applying justify-content: space-between !important;, Moeed effectively told the browser to distribute the content within that card – including the image, title, price, and most importantly, the buy button – with equal space between them, pushing the button right to the bottom where it belongs.
Here’s how to implement this fix on your own Shopify store:
Step-by-Step: Removing the Empty Space
A quick but crucial note before you begin: Whenever you’re editing your theme code, it’s always a good idea to duplicate your theme first. This creates a backup, so if anything goes awry, you can easily revert to the previous version without any headaches!
- Head over to your Shopify Admin dashboard.
- In the left sidebar, navigate to Online Store > Themes.
- Find your current theme (like the Horizon theme in xsanxdrox's case) and click Actions > Edit code.
- In the left sidebar of the code editor, look for the "Layout" directory and click on the
theme.liquidfile. This file acts as the main template for your entire store. - Scroll all the way down to the very bottom of the
theme.liquidfile. - Just above the closing
