How to align all button in the row?

Topic summary

A Shopify theme developer is experiencing misalignment of “Add to Cart” buttons in a product grid after adding review ratings to some products. The buttons appear at different vertical positions because products with ratings have additional content, pushing their buttons lower.

Solution Provided:
A PageFly representative offered CSS code to be added to the theme.liquid file above the </head> tag. The solution successfully aligned all buttons to the same position.

Current Status:
The alignment issue is resolved for desktop view, but the original poster reports the fix doesn’t work properly on mobile/responsive layouts. They’ve requested additional help to make the product display responsive across different screen sizes.

Technical Context:
The issue involves a custom Shopify collection page displaying products in a flex-based grid layout with product cards containing images, titles, descriptions, and form buttons.

Summarized with AI on November 8. AI used: claude-sonnet-4-5-20250929.

Now the add to cart is not aligned after I added some review ratings for some products. Does anyone how to make Add to cart lower for all the products?

  <div class="product-container">
    <div class="all-products-wrapper">
      {% for product in collections['lens-1'].products %}
<br>
        <div class="product-card">
          <img
            width="100"
            height="90"
            loading="lazy"
            src="{{ product.featured_image | image_url}}"
          >
          <h5>{{- product.title   | link_to: product.url }}</h5>
<p>{{- product.description | truncate: 150 }}</p>

<div>
<form method="post" action="/cart/add">
  <input type="hidden" name="id" value="{{ product.variants.first.id }}" />
  
  <input type="submit" value="Select Lens" class="btn" />

</form>
</div>
        </div>
      {% endfor %}
    </div>
  </div>
</section>

<style>

@media(max-width:767px){
.product-card {
width:50% !important;
max-width:50% !important;

}
}
.btn{
min-height:50px;

}
  .all-products {
    background: {{ section.settings.background }}
    ;
    color: {{ section.settings.text_color }}
    ;
    padding: 10px;

  }

  .all-products-wrapper {
      
      transition: transform 0.3s ease; /* Add smooth transition effect */

  }
  .product-container {
    position: relative;
    overflow-x: scroll;

  }

  .product-card {
    width:30%;
    padding: 10px;
    box-sizing: border-box;
    
    flex-direction: column;
    justify-content: center;
    align-items: center;

    }

    .product-card h3 a {
      color: black;
      text-decoration: none

    }

    .product-card a:hover {
      text-decoration: underline;
    }
</style>
1 Like

Hi @atulsaini1989

Can i take a look, would you mind to share your store URL? Thanks!

https://eyejack.in/collections/lens-1

Hi @atulsaini1989

This is Richard from PageFly - Shopify Page Builder App

Please add this code to your theme.liquid above the to get this solved

Step 1: Online Stores > Themes > More Actions > Edit code

Step 2: click on theme.liquid and paste the code above the


Hope this can help you solve the issue

Best regards,

Richard | PageFly

Thank you so much…it works perfect but not responsive.

Can you please help me with the responsive part also? I want to show these products in mobile also.