CSS The object-position Property
The CSS property called object-position
is used to decide where to put an <img> or <video> inside its box.
The Image
Here's a picture from Paris, and it's 400x300 pixels in size.

Next, we employ object-fit: cover
to maintain the image's shape and completely fill the specified size. Nevertheless, the image will be cropped to match, like this:

Using the object-position Property
Suppose the visible part of an image isn't where we want it to be. To move the image to the right place, we'll use the "object-position" property.
In this example, we'll employ the object-position
property to place the image where ever you want.

In this example, we're going to use the object-position
property to place the image in a way that makes the Eiffel Tower appear in the center.

CSS Object-* Properties
Below is a table that shows CSS object-* properties:
Property | Description |
---|---|
object-fit | Describes how to change the size of an <img> or <video> to fit inside its box. |
object-position | Describes where to place an image or video using specific horizontal (x) and vertical (y) coordinates within its own content box. |