Skip to content

background-position

Utilities for controlling the focal position of background images and gradients.

BackgroundsTailwind v4 Spec
ISS preview
Iced + ISS preview demonstrating background-position
ISS preview for background-position
use iced::widget::container;
use iss::{tw, TwExt};
let card = container(body).tw(tw!("bg-radial bg-top-right from-blue-500/30 to-transparent p-5"));
Tailwind Class CSS Property / Effect iss::typed Builder
bg-center / bg-top / bg-bottom background-position: center / top / bottom; .bg_center() / .bg_top()
bg-left / bg-right background-position: left / right; .bg_left() / .bg_right()
bg-top-left .. bg-bottom-right Corner background positions; .bg_top_left()
bg-[position:20%_40%] Arbitrary background position; .bg_position(BgCoord::Pct(20.0), BgCoord::Pct(40.0))
  • Use bg-[position:...] for arbitrary offsets so ISS disambiguates them from arbitrary colors.

background-size · background-repeat · background-origin