Jump to content

Multiple Aspect Ratios

Recommended Posts

Posted

I want to have one page of portfolio images (2023) to all have an aspect ratio of 1:1, and have another portfolio page (2022) to be 16:9. Is there any code that can do this? Thank you!

  • Replies 3
  • Views 425
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Posted

There may be a CSS only way but I know of no code that does this.

A CSS only solution would be more fragile and may take a fair amount of work. You'd basically be overriding a number of classes for a particular effect.

The advantage of my code is that instead of overriding a bunch of CSS it is replacing the one class name on the body tag to make the aspect ratio change. You can kind of think of it as a programmatic switch that changes the AR.

Find my contributions useful? Please like, upvote, mark my answer as the best ( solution ), and see my profile. Thanks for your support! I am a Squarespace ( and other technological things ) consultant open for new projects.

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.