Jump to content

Two-Column Summary on Mobile

Recommended Posts

On 1/14/2022 at 9:17 AM, RichardL26 said:

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

Hello, hoping someone can help me with some CSS.

I have a summary block with images on my homepage, and I'd like it to display as two columns on mobile. I've tried a few different code blocks on these forums, but none have worked as intended.

Here's the link: https://www.richardalam.com/

Thank you in advance!

Add to Design  >Custom CSS

/* Mobile-Homepage-Summary 2 columns */
@media screen and (max-width:767px) {
body.homepage .summary-item-list {
    display: grid !important;
    grid-template-columns: repeat(2,1fr);
    height: auto !important;
    grid-column-gap: 20px;
    grid-row-gap: 20px;
}

body.homepage .summary-item {
    position: relative !important;
    top: unset !important;
    left: unset !important;
    right: unset !important;
    bottom: unset !important;
    width: 100% !important;
    height: auto !important;
}
}

 

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

Link to comment
On 1/15/2022 at 3:13 AM, tuanphan said:

Add to Design  >Custom CSS

/* Mobile-Homepage-Summary 2 columns */
@media screen and (max-width:767px) {
body.homepage .summary-item-list {
    display: grid !important;
    grid-template-columns: repeat(2,1fr);
    height: auto !important;
    grid-column-gap: 20px;
    grid-row-gap: 20px;
}

body.homepage .summary-item {
    position: relative !important;
    top: unset !important;
    left: unset !important;
    right: unset !important;
    bottom: unset !important;
    width: 100% !important;
    height: auto !important;
}
}

 

Thank you, that worked! However, now I have a different issue. There is a big gap because of the different photo orientations (see attached screenshot).

Is there a way to stagger the photos? Here's an example site that does that (albeit not using Squarespace): https://www.andrewtkearns.com/

 

IMG_0214.PNG

Edited by RichardL26
Link to comment

They have different size, so when coverting to grid, it will have problem like as above.

You can remove the code, we will test some new code

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

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.