Skip to content

background-attachment

Utilities for controlling how a background image or gradient scrolls relative to the viewport or element.

BackgroundsTailwind v4 Spec
ISS preview
Iced + ISS preview demonstrating background-attachment
ISS preview for background-attachment
use iced::widget::container;
use iss::{tw, TwExt};
let hero = container(body).tw(tw!("bg-fixed bg-linear-to-b from-slate-900 to-zinc-950 p-6"));
Tailwind Class CSS Property / Effect iss::typed Builder
bg-fixed background-attachment: fixed; .bg_fixed()
bg-local background-attachment: local; .bg_local()
bg-scroll background-attachment: scroll; .bg_scroll()

background-image · background-position · background-size