Jump to content

Trying to customise gallery for mobile, syntax error

Go to solution Solved by tuanphan,

Recommended Posts

Posted

Hi

I am trying to turn my gallery on home page into 1 image per line on mobile (it is 2 on desktop).

I have copied in this code sourced from this forum but I keep getting a syntax error. What I am I doing wrong?

Thanks!

<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: 0 !important;
    padding-right: 0 !important;
}
}
</style>

Screenshot 2024-06-14 at 1.06.21 pm.png

Screenshot 2024-06-14 at 1.06.09 pm.png

  • Solution
Posted

You need to paste your code to Homepage Header Code Injection.

To access Header Injection > Hover on Homepage (on Main Navigation or Not Linked) > You will see a gear icon > Click on it > Advanced > Look right box.

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!)

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.