Home Menu

object-position

The object-position CSS property determines the alignment of the replaced element inside its box.

Syntax

CSS

object-position: value;

JS

object.style.objectPosition = "value";

Values

<'object-position'> = <position>
<position> = [ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]
left

Left.

center

Center.

right

Right.

top

Top.

bottom

Bottom.

<length-percentage> = [ <length> | <percentage> ]
<length>

Specifies the length using a number followed by a unit of measurement.

<percentage>

Specifies the percentage using a number followed by a percent sign (%).

Initial

50% 50%

Examples

bottom

center

left

length

percentage

right

top

JS

Internal

object-fit

External

World Wide Web Consortium (W3C)

JesusBible
HTMLCSSJSPHPSVGMore
AboutTerms