Jump to content

Limit Gallery Block Image Size

Recommended Posts

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


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
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Posted Images

Add to Home > design > Custom CSS

/* Play icon mobile */
@media screen and (max-width:640px) {
div#block-yui_3_17_2_1_1600056103323_14741 {
    width: 50%;
    margin: 0 auto;


Email me if you have need any help (free, of course.). Answer within 24 hours. 
Or send to forum message

How to: Setup Password & Share url Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care

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.