Jump to content

[Share] Gallery (Grid, Masonry) One column on Mobile

Recommended Posts

To make Gallery one column on mobile, you can use these CSS code to Website Tools > Custom CSS.

If it doesn't work, you can send link to page where you use Gallery, I will check again.

#1. With Gallery Grid

@media screen and (max-width:767px) {
  .gallery-grid-wrapper {
      grid-template-columns: repeat(1,1fr) !important;
  }
}

image.png.50c68ea31700d121f8807e8f23b6d79d.png

#2. With Specific Gallery Grid

First, you need to find Gallery Grid ID. Use below tool

In my example, it will be like this

image.png.35cd1e07a99dd834605a523da310f88c.png

Next, use CSS code like this

@media screen and (max-width:767px) {
 section[data-section-id="660fb69c5ad8264c5dbae2e7"] .gallery-grid-wrapper {
      grid-template-columns: repeat(1,1fr) !important;
  }
}

#3. With Gallery Masonry

@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;
  }
}

#4. With Specific Masonry

Similar #2, find Masonry Section ID, then use CSS code like this

@media screen and (max-width:767px) {
  section[data-section-id="66d3a3595ba3532519b4e0f6"] {
    .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 298
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.