Skip to main content

Background Image

Set the background image of an element.

View as Markdown
baselinewidely
ClassCSS
bi-lg:bbackground-image: linear-gradient(to bottom, oklch(1 0 0 / .18), oklch(0 0 0 / .14));
bi-lg:lbackground-image: linear-gradient(to left, oklch(1 0 0 / .18), oklch(0 0 0 / .14));
bi-lg:nonebackground-image: none;
bi-lg:rbackground-image: linear-gradient(to right, oklch(1 0 0 / .18), oklch(0 0 0 / .14));
bi-lg:tbackground-image: linear-gradient(to top, oklch(1 0 0 / .18), oklch(0 0 0 / .14));

Variants

Prefix any class with a variant to apply it only under that condition. Variants stack, as in @md:h:bi-lg:none.

Breakpoints

Apply a class from a viewport width up. Each breakpoint covers its width & every width above it.

@xs:bi-lg:noneFrom 32rem up.
@sm:bi-lg:noneFrom 40rem up.
@md:bi-lg:noneFrom 48rem up.
@lg:bi-lg:noneFrom 64rem up.
@xl:bi-lg:noneFrom 80rem up.
@xxl:bi-lg:noneFrom 96rem up.

Containers

Apply a class from a container's width up, not the viewport's. Mark the parent with ct:is first.

@c:xs:bi-lg:noneContainer from 32rem up.
@c:sm:bi-lg:noneContainer from 40rem up.
@c:md:bi-lg:noneContainer from 48rem up.
@c:lg:bi-lg:noneContainer from 64rem up.
@c:xl:bi-lg:noneContainer from 80rem up.
@c:xxl:bi-lg:noneContainer from 96rem up.

Media

Apply a class when the device or the page matches a condition, or on the first frame an element renders.

@pc:bi-lg:noneOn a touch screen.
@prm:bi-lg:noneWith reduced motion on.
@st:bi-lg:noneOn the first frame.

States

Apply a class only while the element is in a state, such as hovered, focused or checked.

h:bi-lg:noneOn :hover.
f:bi-lg:noneOn :focus.
fv:bi-lg:noneOn :focus-visible.
a:bi-lg:noneOn :active.
d:bi-lg:noneOn :disabled.
fc:bi-lg:noneOn :first-child.
c:bi-lg:noneOn :checked.
e:bi-lg:noneOn :empty.
fw:bi-lg:noneOn :focus-within.
i:bi-lg:noneOn :invalid.
in:bi-lg:noneOn :indeterminate.
lc:bi-lg:noneOn :last-child.
nc:bi-lg:noneOn :nth-child.
r:bi-lg:noneOn :required.
ro:bi-lg:noneOn :read-only.
v:bi-lg:noneOn :valid.

Pseudo Elements

Style a part of the element rather than the element itself, such as its placeholder or the selected text.

a::bi-lg:noneOn ::after.
b::bi-lg:noneOn ::before.
p::bi-lg:noneOn ::placeholder.
s::bi-lg:noneOn ::selection.