Horje
object-fit Code Example
object-fit
  object-fit: fill;
  object-fit: contain;
  object-fit: none;
  object-fit: scale-down;
object-fit
/* The object-fit CSS property sets how the content of a replaced 
element, such as an <img> or <video>, 
should be resized to fit its container. 

The position of the replaced element can be affected using CSS,
but not the contents of the replaced element itself.
Some replaced elements, such as <iframe> elements,
may have stylesheets of their own, but they don't inherit the styles
of the parent document. */

/* Global */
object-fit: inherit;
object-fit: initial;
object-fit: revert;
object-fit: unset;

/* VALUES */

object-fit: contain;

/*
The replaced content is scaled to maintain its aspect ratio while fitting
within the element’s content box. The entire object is made to fill the
box, while preserving its aspect ratio, so the object will be 
"letterboxed" if its aspect ratio does not match the aspect ratio
of the box.
*/

object-fit: cover;

/*
The replaced content is sized to maintain its aspect ratio
while filling the element’s entire content box. 
If the object's aspect ratio does not match the aspect ratio of its box,
then the object will be clipped to fit.
*/

object-fit: fill;

/*
The replaced content is sized to fill the element’s content box.
The entire object will completely fill the box. 
If the object's aspect ratio does not match the aspect ratio of its box,
then the object will be stretched to fit.
*/

object-fit: none;
/*
The replaced content is not resized.
*/

object-fit: scale-down;

/*
The content is sized as if none or contain were specified, 
whichever would result in a smaller concrete object size.
*/




Css

Related
button style css Code Example button style css Code Example
remove line breaks css Code Example remove line breaks css Code Example
scss comment Code Example scss comment Code Example
Selector CSS Example Code Example Selector CSS Example Code Example
how to align list to the centre in css Code Example how to align list to the centre in css Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8