CSS set the position of the element (img, video) in the container object-position property [accumulation]

The object-position attribute is used to reset the size of the image according to the container size and set the position of the image, similar to the background-position attribute, except that one is to set the position of the background-img in the entire container and the other is to set the position of the element in the container .

1. Instructions for label use:

Object-position is generally used together with object-fit to set the position of an element.

Object-position is generally used for img and video tags.

2. Browser support:
Insert picture description here
3. Syntax:

object-position: position|initial|inherit;

Insert picture description here

Guess you like

Origin blog.csdn.net/weixin_44296929/article/details/108519303