Jump to content

How to adjust the padding on gallery sections for mobile only

Go to solution Solved by Lesum,

Recommended Posts

Hi there, 

Does anyone know how to adjust the padding for a gallery section on mobile only?

It looks fine on web but when the site is opened on mobile, it has larger gaps between the gallery and the text above/below. 

There are gallery sections on both the home page and project page, where this issue occurs. 

Any help would be greatly appreciated. 

366753006_1651758731958484_6921513926187278220_n.jpg

Link to comment

@KTK Here's a code snippet to fix the issue. Let me know how it goes. Thanks!

 

@media only screen and (max-width: 640px) {
	section[data-section-id="64d0612392f77a56f06c23f6"] .gallery-slideshow-wrapper, #collection-646c7dbed1cf465e6b9c9a75 .gallery-slideshow-wrapper {
		max-height: 200px !important;
	}
	section[data-section-id="64d0612392f77a56f06c23f6"] .gallery-slideshow, #collection-646c7dbed1cf465e6b9c9a75 .gallery-slideshow {
		height: auto !important;
		margin-bottom: 80px !important;
	}
}
Edited by Lesum

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment
  • Solution

Please add the code to the Custom CSS panel, not the Page Header Code Injection panel.

You’ll find the Custom CSS panel in Website > Utilities > Website Tools > Custom CSS.

If my comments were useful, please like or mark my solution as answer so others can scroll to it quickly. 

Sam
Web Developer & Digital Designer

 Did you find my contribution helpful? Buy me a coffee?

Link to comment

Add these code on the Custom CSS section.

@media only screen and (max-width: 767px) {
  #collection-646c7dbed1cf465e6b9c9a75, #collection-64216069dee9703e62977c6e {
    .gallery-slideshow[data-show-captions="true"][data-thumbnails="false"] {
      margin-bottom: 70px !important;
      height: 60vw !important;
    }
  }
}

 

Screenshot_125.png

Screenshot_128.png

Screenshot_129.png

Edited by Web_Solutions

If my comments are useful, please like and mark my solution as answer. It will encourage me. Thanks

MD Rofik
Website Designer and Digital Marketer

Am I helpful? Want to offer me a coffee?
Send me a message if needed any help. I'll try to reply as soon as possible.


 

Link to comment
  • 11 months 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.