Jump to content

How to make a Code Block smaller on Mobile view on 7.0?

Go to solution Solved by MartinMurray,

Recommended Posts

Hi All
I'd like to make a code block smaller when in Narrow view (Mobile) by about 60-50%... I've tried a few code snips like the below, with no luck! The code block is holding a scroll Lottie file I made.  Any help would be great. 

/* Mobile resize code block */
@media screen and (max-width:767px) {
div#block-62452260eb439022d3cd {
    width: 50%;
    margin: 0 auto;
}
}

The page is live and open  - https://intropic-info.io/pfi

Screenshot 2022-10-25 at 14.19.55.png

Screenshot 2022-10-25 at 14.20.16.png

Edited by MartinMurray

Your Martin

Link to comment
  • MartinMurray changed the title to How to make a Code Block smaller on Mobile view on 7.0?

Give this a try. It will bring the image to 50% on any device smaller than 640px. If you wish you can change the 640 to the 767 you have but Squarespace for this page looks like its breaking for mobile at 640px. This is only for the lotti custom code image your using.

@media screen and (max-width: 640px)
div#block-62452260eb439022d3cd {
    width: 50%;
}
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.