I’m facing an issue with the placement of the “Add to Cart” button on my Shopify store. Currently, the button is not aligning properly under the product images on both the home page and the collection pages. I would like to adjust its position so that it appears neatly below each product, maintaining a clean and consistent layout.
I’ve tried modifying the theme’s CSS but haven’t been able to achieve the desired alignment. Could someone guide me on how to adjust the button placement properly? Any help or code suggestions would be greatly appreciated.
It looks like the “Add to Cart” button is misaligned and overlapping with the product price. To fix this, you’ll likely need to adjust the CSS of your Shopify theme. Try adding the following CSS to your theme’s stylesheet:
Follow These Steps:
Online store > themes
Click Customize on your active theme (Focal theme).
Click Theme Settings → Custom CSS and add the following code:
Try this and refresh your page. Let me know if you need further adjustments! Please share the URL so I can check exactly and give you the right code to solve this issue.
If I was able to help you, please don’t forget to Like and mark it as the Solution!
If you’re looking for expert help with customization or coding, I’d be delighted to support you. Please don’t hesitate to reach out in my signature below—I’m here to help bring your vision to life!
.product-card .product-image { margin-bottom: 10px; / Adds space between image and button / }
.product-card .add-to-cart { width: 100%; / Ensures full-width alignment / margin-top: auto; / Pushes the button to the bottom / padding: 8px 0; / Adjust padding for better appearance */ }
3. Adjust the HTML Structure (if needed)
If the CSS alone doesn’t fix the issue, you may need to modify your HTML structure slightly:
Locate the product-card.liquid file (or similar) in the Sections or Snippets folder.
Ensure the structure follows this pattern:
|
{{ product.image | img_url: ‘large’ | img_tag }}
{{ product.title }}
{{ product.price | money }}
Add to cart
|
| - |
4. Test and Adjust- Save your changes and refresh your store’s homepage and collection pages.
If the alignment is still off, try adjusting the margin or padding values in the CSS.
Try this method I have also fixed this issue using this method in my website Acunafitness