Layout
Utilities for controlling how a replaced element's content should be positioned within its container.
Class | Styles |
---|---|
object-bottom | object-position: bottom; |
object-center | object-position: center; |
object-left | object-position: left; |
object-left-bottom | object-position: left bottom; |
object-left-top | object-position: left top; |
object-right | object-position: right; |
object-right-bottom | object-position: right bottom; |
object-right-top | object-position: right top; |
object-top | object-position: top; |
object-(<custom-property>) | object-position: var(<custom-property>); |
object-[<value>] | object-position: <value>; |
Use the object-*
utilities to specify how a replaced element's content should be positioned within its container:
Use the object-position-(<custom-property>)
syntax to set the object-position based on a custom property:
<div class="object-position-(--my-object-position) ..."> <!-- ... --></div>
Use the object-position-[<value>]
syntax to set the object-position based on a completely custom value:
<div class="object-position-[25% 75%] ..."> <!-- ... --></div>
Prefix an object-position
utility with a breakpoint variant like md:
to only apply the utility at medium screen sizes and above:
<div class="object-center md:object-top"> <!-- ... --></div>
Learn more about using variants in the variants documentation.
Use the --object-position-*
theme variables to customize the object position utilities in your project:
@theme { --object-position-center-bottom: center bottom; }
Now the object-position-center-bottom
utility can be used in your markup:
<div class="object-position-center-bottom"> <!-- ... --></div>
Learn more about customizing your theme in the theme documentation.