Object Fit
The
object-fit
property is used to specify how an img
or video
should be resized to fit its container. This property tells the content to fill the container in a variety of ways; such as 'preserve that aspect ratio' or 'stretch up and take up as much space as possible'.
Class
|
Properties
|
---|---|
fit-fill |
object-fit: fill |
fit-contain |
object-fit: contain |
fit-cover |
object-fit: cover |
fit-none |
object-fit: none |
fit-scale-down |
object-fit: scale-down |
utilities.scss API