Jump to content

Mobile layout for image block.

Recommended Posts

Posted

Site URL: https://modernbusiness.squarespace.com

Hey. 

Squarespace breaks this into one column on mobile. 
But I would like the images to display in two columns. 

I have a multiple pages of the same. 


Is there a way to do that? 

B135909C-773B-4DBB-92F0-6293AAABE2C1_1_105_c.thumb.jpeg.92c5a0e0fc791d7df1d79dbcfe249984.jpeg

 

EF3576CB-CB2F-42F3-971F-02539904EE33_1_105_c.jpeg

  • Replies 5
  • Views 455
  • Created
  • Last Reply
Posted

Add to Design > Custom CSS

/* Products 2 columns */
@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1618893896866_14059 ~ .row .span-3 {
    width: 50% !important;
    float: left !important;
}
div#block-yui_3_17_2_1_1618893896866_14059 ~ .row .span-3:nth-child(2n+1) {
    clear: 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!)

Posted
5 hours ago, tuanphan said:

Add to Design > Custom CSS


/* Products 2 columns */
@media screen and (max-width:767px) {
div#block-yui_3_17_2_1_1618893896866_14059 ~ .row .span-3 {
    width: 50% !important;
    float: left !important;
}
div#block-yui_3_17_2_1_1618893896866_14059 ~ .row .span-3:nth-child(2n+1) {
    clear: left !important;
}
}

 

Thank you. 

Posted
On 5/2/2021 at 10:30 PM, kristobans said:

Hey @tuanphan.

 

How can I make that it works on multiple pages? 

https://modernbusiness.squarespace.com/categories/accessories

https://modernbusiness.squarespace.com/categories/toiletries

etc.

Basically, I have the same thing on numerous pages. 

Each page needs a different code. If you use Summary or Gallery block, we can target easier with 1 code

/* Mobile 2 columns products */
@media screen and (max-width:767px) {
/* accessories */
div#block-yui_3_17_2_1_1619418261951_140576+.row .span-3 {
    width: 50% !important;
    float: left !important;
}
div#block-yui_3_17_2_1_1619418261951_140576+.row .span-3:nth-child(2n+1) {
    clear: left !important;
}
/* toiletries */
div#block-yui_3_17_2_1_1619424383691_34796+.row .span-3 {
    width: 50% !important;
    float: left !important;
}
div#block-yui_3_17_2_1_1619424383691_34796+.row .span-3:nth-child(2n+1) {
    clear: 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!)

Posted
5 hours ago, tuanphan said:

Each page needs a different code. If you use Summary or Gallery block, we can target easier with 1 code


/* Mobile 2 columns products */
@media screen and (max-width:767px) {
/* accessories */
div#block-yui_3_17_2_1_1619418261951_140576+.row .span-3 {
    width: 50% !important;
    float: left !important;
}
div#block-yui_3_17_2_1_1619418261951_140576+.row .span-3:nth-child(2n+1) {
    clear: left !important;
}
/* toiletries */
div#block-yui_3_17_2_1_1619424383691_34796+.row .span-3 {
    width: 50% !important;
    float: left !important;
}
div#block-yui_3_17_2_1_1619424383691_34796+.row .span-3:nth-child(2n+1) {
    clear: left !important;
}
}

 

Hey. Thank you. I've changed the code for each page. It's easier at this point.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.