Jump to content

2 product blocks on the same row on mobile

Go to solution Solved by Beyondspace,

Recommended Posts

Site URL: https://octopus-pentagon-c2h7.squarespace.com/

Hi!

I really tried not to annoy anyone with my question as I'm sure some people faced the same issue but I can't find the right code for my problem.

On my home page, I've got a row of 4 product blocks that automatically change into 1 per row on mobile.

How can I change them in 2 per row?

Same thing with the text blocks in the footer.

Password:1234

Thanks in advance,

Yann 

Edited by NikosPhadji
Link to comment
  • Solution
On 3/15/2021 at 10:45 PM, NikosPhadji said:

Site URL: https://octopus-pentagon-c2h7.squarespace.com/

Hi!

I really tried not to annoy anyone with my question as I'm sure some people faced the same issue but I can't find the right code for my problem.

On my home page, I've got a row of 4 product blocks that automatically change into 1 per row on mobile.

How can I change them in 2 per row?

Same thing with the text blocks in the footer.

Password:1234

Thanks in advance,

Yann 

You can take advantage of the html block above the product row to target it

@media only screen and (max-width: 600px) {
        #block-yui_3_17_2_1_1613401829864_7597 + .sqs-row .sqs-col-3 {
          width: 50% !important; 
          float: left !important;
        }
        #block-yui_3_17_2_1_1613401829864_7597 + .sqs-row {
            display: flex;
            flex-direction: row;
            flex-wrap: wrap;
        }
}

image.thumb.png.7b978fae0476f48956e71b62f400b872.png

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
On 3/15/2021 at 10:45 PM, NikosPhadji said:

Site URL: https://octopus-pentagon-c2h7.squarespace.com/

Hi!

I really tried not to annoy anyone with my question as I'm sure some people faced the same issue but I can't find the right code for my problem.

On my home page, I've got a row of 4 product blocks that automatically change into 1 per row on mobile.

How can I change them in 2 per row?

Same thing with the text blocks in the footer.

Password:1234

Thanks in advance,

Yann 

Do you still need help?

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!)

Link to comment

Hi guys,

Thank you very much for taking the time to help.

@bangank36 Thank you so much mate. It worked perfectly. I think I tried this code before but use it with a wrong block id.

I could use your help with the text blocks in the footer. Would like to make one row with the text blocks and then the newsletter form underneath.

Thank you again

Link to comment
  • 1 year later...

Hi all, 

Thanks so much for posting this, it has been really helpful and fixed my problem also. I have noticed, however that it doesn't work on all the product blocks on the site. I had previously thought it was because some product blocks were in an accordion but I have removed them from this and it is still not working. 

It works on the top section of product blocks but when these lower down blocks are separated by heading text it stops working. Are you able to help?

Thanks,

Chloe

Screenshot 2022-09-04 at 12.19.31.png

Screenshot 2022-09-04 at 12.19.24.png

Link to comment
14 hours ago, cloecloa said:

Hi all, 

Thanks so much for posting this, it has been really helpful and fixed my problem also. I have noticed, however that it doesn't work on all the product blocks on the site. I had previously thought it was because some product blocks were in an accordion but I have removed them from this and it is still not working. 

It works on the top section of product blocks but when these lower down blocks are separated by heading text it stops working. Are you able to help?

Thanks,

Chloe

Screenshot 2022-09-04 at 12.19.31.png

Screenshot 2022-09-04 at 12.19.24.png

What is your site url? We can check easier

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!)

Link to comment
On 9/5/2022 at 3:27 PM, cloecloa said:

Hello, thank you for replying! The page I am trying to sort this on is below

 

https://www.howaboutnope.com/shop

Try adding to Design > Custom CSS
 

@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1662289636552_14255~.row .span-4 {
    width: 50% !important;
    float: left !important;
}
}

 

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!)

Link to comment

Hi Tuanphan, 

Thank you so so much for your help! That sorted the bulk buy sections and I can swap out the block-yui code for all other sections. 

I did try it for the "single bars" section and it doesn't work, from what I see it only has a block- Id. I attached a screenshot because not sure if it is possible in accordion or if I need a different id number?

1115676328_Screenshot2022-09-06at17_36_43.thumb.png.34cfa31e219f8f13de6fe3072e73d525.png

Link to comment
On 9/6/2022 at 11:39 PM, cloecloa said:

Hi Tuanphan, 

Thank you so so much for your help! That sorted the bulk buy sections and I can swap out the block-yui code for all other sections. 

I did try it for the "single bars" section and it doesn't work, from what I see it only has a block- Id. I attached a screenshot because not sure if it is possible in accordion or if I need a different id number?

1115676328_Screenshot2022-09-06at17_36_43.thumb.png.34cfa31e219f8f13de6fe3072e73d525.png

With single bars, use this code

@media screen and (max-width:640px) {
div#block-665a664b59457cba898d+div .span-6 {
    width: 50% !important;
    float: left !important;
}
}

 

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!)

Link to comment

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.