Vertically Center an Image in a Block

What does this code do?

This code snippet will allow you to vertically center an image in various image blocks.

Computer (2).jpg
 

Code Snippets

Copy and paste the code for the image block style of your choice into Design > Custom CSS.

/* Card Image Block */ .image-block .design-layout-card { display: flex; align-items: center; } /* Overlap Image Block */ .image-block .design-layout-overlap { display: flex; align-items: center; } /* Collage Image Block */ .image-block .design-layout-collage { display: flex; align-items: center; }
 

How To Use It

  1. Copy and paste the code as indicated above.

Rebecca Grace

Rebecca Grace is a Squarespace CSS Expert and Website Designer.

https://rebeccagracedesigns.com
Previous
Previous

Add Multiple Buttons in the Header

Next
Next

Animate the Announcement Bar