How to get the image in a cover block to keep the aspect ratio but shrink / expand to fit properly?

[ad_1]

As above, here are some more details.

I have managed to use CSS to make the cover block a perfect square, same aspect ratio of my image (1080px X 1080px if it matters).

The problem is that the image is zoomed in, as in I can only see a small part of the image.

I can’t see any tools within the WordPress cover block settings that would allow the image to fit properly.

I have tried adding Custom CSS with Object-Fit : contain but it seems to ignore it.

Any ideas? Thanks

[ad_2]
2 Comments
  1. You need to either set the image as a background with ‘background-saze:cover;’

    Or use ‘object-fit: cover;’ to force aspect ratio. Depending on the layout, target the DIV that contant the img – or the img directly. Or post a url and we can tell you what the css needs to be.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer