Skip to content

object-position

Utilities for controlling the focal alignment of an image inside its container bounds.

ISS preview
Iced + ISS preview demonstrating object-position
ISS preview for object-position
use iss::{image_tw, tw};
let portrait = image_tw(handle, tw!("size-24 object-cover object-top rounded-full"));
Tailwind Class CSS Property / Effect iss::typed Builder
object-center object-position: center; .object_center()
object-top / bottom object-position: top / bottom; .object_top() / .object_bottom()
object-left / right object-position: left / right; .object_left() / .object_right()
object-top-left .. object-bottom-right object-position: top left .. bottom right; .object_top_left()
object-left-top / object-right-bottom Alias corner positions; .object_top_left() / .object_bottom_right()
  • Use with image_tw(handle, style) alongside object-cover or object-none.

object-fit · aspect-ratio · background-position