Jump to content

Having two products appear side by side on mobile in 7.1

Recommended Posts

Posted

Site URL: https://www.periodicoemporium.com/

Hi,

I am trying to get two products to appear side by side on mobile for my homepage and other main pages throughout the site. I checked the forum and the following code was listed:

@media only screen and (max-width:640px) {
.products .list-grid {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
}
.products .grid-item {
width: 48%;
}
}

However, I have tried this and it still doesn't work. Does anyone have any other ideas?

Thanks,

Nadia

Posted

I also used this code as a someone said it was a fix and it didn't work either:

<style>
  @media screen and (max-width:763px) {
.products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-column-gap: 5px;
    grid-row-gap: 5px;
}
}
</style>

Posted
On 7/29/2021 at 3:57 AM, PeriodicoEmporium said:

I also used this code as a someone said it was a fix and it didn't work either:

<style>
  @media screen and (max-width:763px) {
.products.collection-content-wrapper .list-grid {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr)) !important;
    grid-column-gap: 5px;
    grid-row-gap: 5px;
}
}
</style>

With homepage, add this to Design > Custom CSS

/* home 2 products row */
@media screen and (max-width:767px) {
div#page-section-6101a639f637f965fb180af8 .span-3 {
    width: 50% !important;
    float: left !important;
}
div#page-section-6101a639f637f965fb180af8 .span-3:nth-child(2n+1) {
    clear: left !important;
}
}

Can you share link to other pages?

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

  • 1 month later...
  • 7 months later...
  • 1 year later...
Posted
2 hours ago, cristianmanuel said:

@tuanphanmay you help with my site? https://www.avdcmty.com/shop would like mobile to be 2 on each row instead of stacked - thank you 

Add this to Website Tools (under Not Linked) > Custom CSS

@media screen and (max-width:640px) {
.ProductList-grid {
    display: grid;
    grid-template-columns: repeat(2,1fr);
}
}

image.png.c77850a477b91d7e8874dc94f514f91b.png

Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)

Create an account or sign in to comment

You need to be a member in order to leave a comment

×
×
  • Create New...

Squarespace Webinars

Free online sessions where you’ll learn the basics and refine your Squarespace skills.

Hire a Designer

Stand out online with the help of an experienced designer or developer.