Jump to content

Limit Gallery Block Image Size

Recommended Posts

Site URL: https://www.rafida.org

Hey,

I'm trying to limit the maximum size of an image on mobile. 
This code used to work for image blocks, but not working for gallery blocks.
The reason I switched to a single image gallery rather than an image block is for the video lightbox function.

The image I'm trying to restrict is the large orange play button at the top of the home page.
Any idea why it's not working?

website: rafida.org
pass: lastphasetesting3

 

- Code provided below.
- Screenshot provided of single image gallery I'm trying to restrict on mobile

 

@media screen and (max-width:640px) {
div#block-yui_3_17_2_1_1600057330272_455 img {
    width: 50% !important;
    height: auto !important;
    transform: translateX(-50%);
    left: 50% !important;
    top: 0 !important;
}
div#block-yui_3_17_2_1_1600057330272_455 .image-block-wrapper {
    padding-bottom: 50% !important;
}
}

 

Screenshot 2020-09-14 at 05.30.14.png

Link to comment
  • Replies 2
  • Views 1.1k
  • Created
  • Last Reply

Archived

This topic is now archived and is closed to further replies.


×
×
  • 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.