object-fit: cover
If you're inclined to use
background-size: cover;
as a default way of controling image sizes, consider starting with
object-fit: cover;
as a first measure. It has
decent support in modern browsers
, but IE and Edge are still lagging behind. Read more on
CSS Tricks
.
object-fit: cover;