Jump to content

Gallery Padding - Desktop vs Mobile

Go to solution Solved by tuanphan,

Recommended Posts

Hello Forum,

I've been using this block of code in the advanced  panel of 'Page Settings' in order to assure that on a mobile device the gallery images display as a single column. The problem I'm having is that it doesn't add any padding below the images and they just stack on top of each other. Anyone know if I can alter this code to adjust bottom padding?

 

As a crappy workaround I just added a caption to every photo which is set to <br> but it adds too much padding to both the mobile and the desktop photos (see screenshot below).

 

Thank you for any thoughts.

Mike.

 

 

 

 

<style>
  @media screen and (max-width:767px) {
    .gallery-masonry-wrapper.gallery-masonry-list--ready {
    height: auto !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: 2 !important;
    padding-right: 2 !important;
}
}
</style>

Screen Shot 2022-11-19 at 3.38.04 PM.png

Screen Shot 2022-11-19 at 3.40.51 PM.png

Link to comment
14 hours ago, Parz1978 said:

Hello Forum,

I've been using this block of code in the advanced  panel of 'Page Settings' in order to assure that on a mobile device the gallery images display as a single column. The problem I'm having is that it doesn't add any padding below the images and they just stack on top of each other. Anyone know if I can alter this code to adjust bottom padding?

 

As a crappy workaround I just added a caption to every photo which is set to <br> but it adds too much padding to both the mobile and the desktop photos (see screenshot below).

 

Thank you for any thoughts.

Mike.

 

 

 

 

<style>
  @media screen and (max-width:767px) {
    .gallery-masonry-wrapper.gallery-masonry-list--ready {
    height: auto !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: 2 !important;
    padding-right: 2 !important;
}
}
</style>

Screen Shot 2022-11-19 at 3.38.04 PM.png

Screen Shot 2022-11-19 at 3.40.51 PM.png

Can you share your site with the protected password so I can take a look?

BeyondSpace - Squarespace Website Developer

🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox)
🗓️ Delivery Date Picker (Squarespace Date picker form field)
💫 Gallery block 7.1 workaround
🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations)
🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates)

If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you!

 

Link to comment
  • Solution
On 11/21/2022 at 4:41 AM, Parz1978 said:

https://parziale.squarespace.com/config/pages

Is this the link you would need? POW is the name of the subpage. Password should be set to public.

 

Thanks for taking a look and let me know if that's not the right link.

Mike

Add margin-bottom to this code

figure.gallery-masonry-item {
    position: relative !important;
    width: 100% !important;
    transform: unset !important;
	margin-bottom: 20px !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.