Streaming live at 10am (PST)

How to auto "crop" CMS collection list images (16:9 aspect ratio example)

** Long scroll but less than 1 min to implement.

"The Problem"
You want to upload difference size images and always keep aspect ratio of 16:9 (Or any other aspect ratio).

Without any styles this is the result “broken layout”:

End result:


1/2. By background-image

First, its easier to solve this by empty div and BG-images (Use background-position: center center; and background-size: cover;

About the height? Set height to 0 and use padding-top.

Example: 16:9 Aspect Ratio

   padding-top: 56.25%; /*  **16:9 Aspect Ratio**  */



2/2. A better solution - by “images”

Why to use images? (And not bg)
1. Fast loading (responsive image), Better 2. SEO(And better Image SEO), Improve 3. Accessibility (Remember to add image alts). And last, more valid code.

How to:

  1. Add wrapper for the image
  2. Set the wrapper position to relative and padding-top to 56.25%:
  3. Add class for the image and set this values:
  • width: 100%;
  • height:100%;
  • position: absolute;

Middle result:
The “vertical image” squeeze (Because we set the height and width to 100%).

— Last Step – Solution.
Add one line of custom code:

  1. If you don’t know css get the selector like this (right click and inspect)
  2. get class name
  3. Add this custom code block (Before body/head per page/entire-project).
/* The object-fit property defines how an element responds 
to the height and width of its content box. */
.post-thumbnail {
	object-fit: cover;

object-fit docs:


Publish :slight_smile:

LIVE URL result:


You don’t want to crop images. Use masonry

By custom code:

By webflow:


If you want to use “img” trick above for regular flexbox grid ("not CMS"). Do not add padding-bottom: 56.25% For the col himself (Create extra div/wrapper):


1 Like

Thanks for sharing @Siton_Systems :webflow_heart:

1 Like