Jump to content

[Share] Gallery Masonry One colum on Mobile

Recommended Posts

To make Gallery Masonry to one column on Mobile, you can use these CSS code. If you can't make it work, you can send site url, I will check it again.

#1. Masonry on All Pages

@media screen and (max-width:767px) {
.gallery-masonry-item-wrapper {
height: auto !important;
margin-bottom: 30px !important;
}
figure.gallery-masonry-item {
position: relative !important;
width: 100% !important;
transform: unset !important;
}
.gallery-masonry-item-wrapper {
height: auto !important;
}
.gallery-masonry .gallery-masonry-item[data-loaded] img {
width: 100% !important;
}
.gallery-masonry {
padding-left: 10 !important;
padding-right: 10 !important;
}
.gallery-masonry-wrapper.gallery-masonry-list--ready {
height: auto !important;
}}

image.png.7c0186238f7e5559d363bb3fc0ed3af2.png

#2. Masonry on One Page

First, you need to find the Page ID. Use below tool.

In my example, we will have: #collection-667f8bab720ee26389417857

image.png.26c4f893e4f917b012544b67186c10df.png

Next, use this CSS code to Custom CSS box.

@media screen and (max-width:767px) {
#collection-667f8bab720ee26389417857 {
.gallery-masonry-item-wrapper {
height: auto !important;
margin-bottom: 30px !important;
}
figure.gallery-masonry-item {
position: relative !important;
width: 100% !important;
transform: unset !important;
}
.gallery-masonry-item-wrapper {
height: auto !important;
}
.gallery-masonry .gallery-masonry-item[data-loaded] img {
width: 100% !important;
}
.gallery-masonry {
padding-left: 10 !important;
padding-right: 10 !important;
}
.gallery-masonry-wrapper.gallery-masonry-list--ready {
    height: auto !important;
}}}

image.png.0b39d148521bb86a2866899b7af89d2f.png

#3. Specific Gallery Masonry

First, you need to find the Masonry Section ID. Use #2 tool.

In my example, we have: section[data-section-id="669f7200f32d0e0ff44bb2b1"]

image.png.05447b2393643be6160f3e4bb7a61622.png

Next, use this CSS code

@media screen and (max-width:767px) {
section[data-section-id="669f7200f32d0e0ff44bb2b1"] {
.gallery-masonry-item-wrapper {
height: auto !important;
margin-bottom: 30px !important;
}
figure.gallery-masonry-item {
position: relative !important;
width: 100% !important;
transform: unset !important;
}
.gallery-masonry-item-wrapper {
height: auto !important;
}
.gallery-masonry .gallery-masonry-item[data-loaded] img {
width: 100% !important;
}
.gallery-masonry {
padding-left: 10 !important;
padding-right: 10 !important;
}
.gallery-masonry-wrapper.gallery-masonry-list--ready {
    height: auto !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
  • Replies 0
  • Views 591
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

Posted Images

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.