object-fit, object-position attributes

The relationship between object-fit and object-position is somewhat similar to background-size and background-position

object-fit:fill (Chinese definition of "fill". Default value. The replacement content stretches to fill the entire content box, and the original ratio is not guaranteed.)
object-fit:contain (Chinese definition of "contains". Keep the original size Proportion. Ensure that the replacement content size can fit in the container. Therefore, this parameter may leave blanks in the container.)
object-fit:cover (Chinese meaning "cover". Maintain the original size ratio. Ensure replacement content The size must be larger than the size of the container, and at least one of the width and height is the same as the container. Therefore, this parameter may make some areas of the replaced content (such as pictures) invisible.)
object-fit:none (Chinese meaning "none". Keep the original Size ratio. At the same time, the original size of the replacement content is maintained.)
object-fit:scale-down (Chinese meaning "reduce". It is as if none or contain are set in turn, and the one with the smaller size is finally rendered.)

The img replacement element and the src replacement content are two independent bodies

Detailed address: http://www.zhangxinxu.com/wordpress/?p=4676

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325249619&siteId=291194637