Skip to main content

Background Attachment

Utilities for controlling how a background image behaves when scrolling.

CSS Property:background-attachment
Classes:3

Background Attachment Classes

ClassCSS
bg-fixedbackground-attachment: fixed;
bg-localbackground-attachment: local;
bg-scrollbackground-attachment: scroll;

Arbitrary Values

You can use arbitrary values with square bracket notation when you need a specific value not included in the default scale.

[background-attachment:value]

Responsive Variants

Apply background attachment utilities at specific breakpoints using responsive prefixes.

BreakpointPrefixExample
640px+sm:sm:bg-fixed
768px+md:md:bg-fixed
1024px+lg:lg:bg-fixed
1280px+xl:xl:bg-fixed
1536px+2xl:2xl:bg-fixed