Skip to content

Layout

Object Position

Utilities for controlling how a replaced element's content should be positioned within its container.

Quick reference

ClassDescription
object-bottomobject-position: bottom
object-centerobject-position: center
object-leftobject-position: left
object-left-bottomobject-position: left bottom
object-left-topobject-position: left top
object-rightobject-position: right
object-right-bottomobject-position: right bottom
object-right-topobject-position: right top
object-topobject-position: top

Basic usage

Positioning a replaced element

Use the object-{side} utilities to specify how a replaced element’s content should be positioned within its container.

.object-left-top
AI generated picture of 1950s scientists working on a warp drive
.object-top
AI generated picture of 1950s scientists working on a warp drive
.object-right-top
AI generated picture of 1950s scientists working on a warp drive
.object-left
AI generated picture of 1950s scientists working on a warp drive
.object-center
AI generated picture of 1950s scientists working on a warp drive
.object-right
AI generated picture of 1950s scientists working on a warp drive
.object-left-bottom
AI generated picture of 1950s scientists working on a warp drive
.object-bottom
AI generated picture of 1950s scientists working on a warp drive
.object-right-bottom
AI generated picture of 1950s scientists working on a warp drive
html
<img class="object-none object-left-top ..." src="..." alt="..." />
<img class="object-none object-top ..." src="..." alt="..." />
<img class="object-none object-right-top ..." src="..." alt="..." />
<img class="object-none object-left ..." src="..." alt="..." />
<img class="object-none object-center ..." src="..." alt="..." />
<img class="object-none object-right" src="..." alt="..." />
<img class="object-none object-left-bottom ..." src="..." alt="..." />
<img class="object-none object-bottom ..." src="..." alt="..." />>
<img class="object-none object-right-bottom ..." src="..." alt="..." />

Applying conditionally

Breakpoints and media queries

You can also use variant modifiers to target media queries like responsive breakpoints, dark mode, prefers-reduced-motion, and more. For example, use md:object-top to apply the object-top utility at only medium screen sizes and above.

html
<img class="object-center md:object-top" src="...">

Released under the Apache 2.0 License.