Jump to content

HELP: TWO IMAGE BLOCKS PER ROW ON MOBILE VIEW

Recommended Posts

Site URL: http://www.onyxmodelmanagement.com

Hi, I need some help with my site. I've tried a few codes but nothing has worked so far.

On my index page, I have a lot of image blocks that are in four columns on my desktop site view. They are individual image blocks, not a gallery. On mobile, it stacks all of the images on top of each other and it is too much scrolling. I would like to have two images per row on mobile view.

Here is the link to the page I'm trying to fix: http://www.onyxmodelmanagement.com/rocket-city-1

This is what it looks like on desktop: 

1831535877_ScreenShot2022-04-02at5_43_57PM.thumb.png.2f97b50080370b2d77e06d578433effe.png

 

Here is what it looks like on mobile:

1777303185_ScreenShot2022-04-02at5_46_07PM.thumb.png.dcf20e1d045f6faac670fc61e7e882b6.png

 

Here is what I would like it to look like on mobile:

2016509008_ScreenShot2022-04-02at5_44_38PM.thumb.png.282d3967d976a3f1d2ab6813c04deb87.png

 

Can anyone help? Thank you!!

Link to comment

@tuanphan

Thank you so much for your help with the coding! It worked perfectly! I appreciate it so much. I was curious if you could help me on another page as well.

I have another index page, "Iron City" that is basically the exact same set up as the "rocket city" page you helped me with. I tried to use the code with the appropriate section ID for the iron city page, but the code is not working for it. Can you help me with it? I just want the two images per row on Mobile devices.

Link: http://www.onyxmodelmanagement.com/iron-city

Link to comment
3 hours ago, JANNAPARK said:

 

@tuanphan

Thank you so much for your help with the coding! It worked perfectly! I appreciate it so much. I was curious if you could help me on another page as well.

I have another index page, "Iron City" that is basically the exact same set up as the "rocket city" page you helped me with. I tried to use the code with the appropriate section ID for the iron city page, but the code is not working for it. Can you help me with it? I just want the two images per row on Mobile devices.

Link: http://www.onyxmodelmanagement.com/iron-city

It looks like you fixed it?

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
8 minutes ago, JANNAPARK said:

@tuanphan I was able to fix the code, however, the pages look great at the top, but once you scroll half way down, the images start separating and only showing on one side. Do you know how to fix this?

937533212_ScreenShot2022-04-03at10_20_31AM.thumb.png.8b3a6edc09b8aca01ac4f86931af7a9c.png819504118_ScreenShot2022-04-03at10_20_42AM.thumb.png.fc238d7f7f477003ef359eb71b28bf92.png

Try this new code

@media screen and (max-width: 767px) {
    div#page-6248d86e464a9b51666cef43 .span-3 {
        width:50% !important;
        float: left !important;
    }
div#page-6248d86e464a9b51666cef43 .span-6+.span-3 {
    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!)

Link to comment

@tuanphan

It doesn't seem to be working on Rocket City page. I have another question - because of the way I have the images set up on the page, it might be easier if I had the four columns on mobile just like I have it on desktop that way everything stays in alphabetical order from left to right. Can you give me a code to make it 4 columns instead of two? I think this will fix all of the problems. Thank you! You are such a big help.

Link to comment
8 hours ago, JANNAPARK said:

@tuanphan

It doesn't seem to be working on Rocket City page. I have another question - because of the way I have the images set up on the page, it might be easier if I had the four columns on mobile just like I have it on desktop that way everything stays in alphabetical order from left to right. Can you give me a code to make it 4 columns instead of two? I think this will fix all of the problems. Thank you! You are such a big help.

First, remove this code

@media screen and (max-width: 767px) {
    div#page-6248d86e464a9b51666cef43 .span-3 {
        width:50% !important;
        float: left !important
    }
}

Next, add this code

@media screen and (max-width: 767px) {
    div#page-6248d86e464a9b51666cef43>.row:nth-child(2)>.span-3 {
        width: 25% !important;
        float: left !important;
    }
    div#page-6248d86e464a9b51666cef43>.row:nth-child(2)>.span-6, div#page-6248d86e464a9b51666cef43>.row:nth-child(2)>.span-6 .span-3 {
        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
  • 2 months later...
5 hours ago, bellbellbell said:

Hi @tuanphan I'm trying to do the same thing on my page www.fayebell.com/landing1 but have the circle images be 3 wide on mobile. Do you have any suggestions? Thanks!

The url doesn't exist

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 6/28/2022 at 7:16 AM, bellbellbell said:

@tuanphan Yes all the circular image blocks below that

Add to Design > Custom CSS

@media screen and (max-width:767px) {
div#block-62b487497e957602cd166a27~.row .span-2 {
    width: 33.3333% !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.