New Landing How can we help? Themeforest Theme Support Neighborhood Store grid alignment on smaller screens when products have irregular heights

Viewing 2 posts - 1 through 2 (of 2 total)
  • #112852
    Wintermute
    Member
    Post count: 31

    For anyone that has experienced the problem where the grid alignment of store items fails on small screens (<767 px), in my case due to products with long names that wrap several lines, there is a pretty simple fix that worked for me.

    @media only screen and (max-width: 767px) {
        .woocommerce ul.products li.product:nth-child(2n),
        .woocommerce-page ul.products li.product:nth-child(2n) {
            float: left;
        }
    }

    For whatever reason, a WooCommerce stylesheet was forcing these items to float right, which caused some funky alignment issues; things ended up looking like a two column masonry grid. This propagates down the page, so if you have more than a few items with larger heights, it turns into a mess and looks pretty bad. This problem is not apparent if your products have short, or equally long names. In any event, I am relatively certain that this is a general case and not particular to me, but I can’t be one hundred percent certain, so your mileage may vary.

    #112929
    Mohammad – SUPPORT
    Moderator
    Post count: 27441

    Great! Thanks to sharing this solution. We highly appreciate it.
    Thanks 🙂
    With Best Regards
    Mohammad

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register