PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 1, 2022

[FIXED] How to auto align grid items?? [Shopify]

 July 01, 2022     css, html, javascript, shopify     No comments   

Issue

It's possible to align all the grid items if they have different content size??? Check the my image below as example: enter image description here

Test Site : https://strokes-test.myshopify.com/

Code for li.griditems

  <li class="grid__item grid__item--{{section.id}} {{ grid_item_width }}">
        {% include 'product-grid-item', max_height: max_height, product: product, show_vendor: section.settings.show_vendor %}
      </li>

Solution

Add this css.

.grid--view-items {
    overflow: auto;
    margin-bottom: -35px;
    display: flex;
    flex-wrap: wrap;
}
.grid--view-items li.grid__item .products {
    height: 100%;
    display: flex;
    flex-wrap: wrap;
}
.products .product_left {
    float: left;
    width: 100%;
    height: 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
}

It will look like this. enter image description here



Answered By - DVS
Answer Checked By - Willingham (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing