PositioningObject Position

Object Position

Controls how to position the container's content.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari
ClassStyle
op-bobject-position: bottom;
op-cobject-position: center;
op-lobject-position: left;
op-lbobject-position: left bottom;
op-ltobject-position: left top;
op-robject-position: right;
op-rbobject-position: right bottom;
op-rtobject-position: right top;
op-tobject-position: top;

This example showcases various object-position utilities:

  • The bottom object position utility aligns the object to the bottom edge of the container.
  • The center object position utility centers the object within the container.
  • The left object position utility aligns the object to the left edge of the container.
  • The right object position utility aligns the object to the right edge of the container.
  • The top object position utility aligns the object to the top edge of the container.
<div class="d-g g-1 gtc-3">
<img class="d-24 of-none op-lt" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-t" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-rt" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-l" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-c" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-r" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-lb" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-b" src="/img/lighthouse.jpg" />
<img class="d-24 of-none op-rb" src="/img/lighthouse.jpg" />
</div>

Using utility variants

Learn how to override existing utilities based on the user's screen size or other factors, such as hover states.

Targeting different viewports

You can combine responsive breakpoints like sm:op-*, md:op-*, lg:op-*, and xxl:op-* to allow targeting specific utilities in different viewports.

Targeting hover states

Alternatively, you can apply :hover by using h:op-* utility to override elements and change their values when hovering over them.