Jump to content

Masonry Gallery on Desktop, but fill images on mobile.

Go to solution Solved by tuanphan,

Recommended Posts

Posted (edited)

Hey all, 

So i have a gallery here, what I would like, is for the gallery to be shown as normal form a desktop, but revert to a single column of images when viewed from a mobile device. So the width of the image fills the screen.

Can this be done?

Edited by pace
Forgot some info
Link to comment
  • Replies 5
  • Views 669
  • Created
  • Last Reply

Top Posters In This Topic

You can use this code to Website > Website Tools > Custom CSS

@media screen and (max-width:767px) {
body#collection-66363911edab9a0597b23a98 {
	.gallery-masonry-wrapper.gallery-masonry-list--ready {
    height: auto !important;
    display: grid;
    grid-template-columns: repeat(1,1fr) !important;
    grid-column-gap: 10px;
    grid-row-gap: 10px;
}
figure.gallery-masonry-item {
    position: relative !important;
    width: 100% !important;
    transform: unset !important;
}
.gallery-masonry-item-wrapper {
    height: 100% !important;
}
.gallery-masonry-item-wrapper  img {
	width: 100% !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
  • Solution

Each page will have a different code. You can share link to Faces of Shanghai, I can check easier.

Or you can use this new code, it will apply all masonry gallery

@media screen and (max-width:767px) {
	.gallery-masonry-wrapper.gallery-masonry-list--ready {
    height: auto !important;
    display: grid;
    grid-template-columns: repeat(1,1fr) !important;
    grid-column-gap: 10px;
    grid-row-gap: 10px;
}
figure.gallery-masonry-item {
    position: relative !important;
    width: 100% !important;
    transform: unset !important;
}
.gallery-masonry-item-wrapper {
    height: 100% !important;
}
.gallery-masonry-item-wrapper  img {
	width: 100% !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
  • 3 weeks later...

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.