Jump to content

How do I center the content in a cropped code block

Recommended Posts

Hi,

I have used a code block to contain an image and have created some code to allow this code block to crop relative to the page dimensions. I am however unsure how to keep the content centered vertically rather than cropping from the top.

Here is an example of my current css

.sqs-block { 
  padding: -0 !important;
  margin-top: -0px;
  margin-bottom: -0px;
  object-fit: cover;
  max-height: 50vh;
}

Many thanks

Link to comment
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

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.