Background Origin

Set the background positioning area relative to borders, padding & content.

Widely available

This feature is well established and works across many devices and browser versions.

Chrome
Edge
Firefox
Safari

Usage

Padding Box

The background image positioning area extends to the outer edge of the padding, excluding the border.

<div class="w-20 h-20 p-2 bc-pb bo-pb bg-indigo bc-indigo-4 bw-3 bs-d"></div>

The background image positioning area includes the border area.

<div class="w-20 h-20 p-2 bc-bb bo-bb bg-indigo bc-indigo-4 bw-3 bs-d"></div>

The background image positioning area clips to the content area, excluding padding & borders.

<div class="w-20 h-20 p-2 bc-cb bo-cb bg-indigo bc-indigo-4 bw-3 bs-d"></div>

Responsiveness

Use breakpoint prefixes to target different screen sizes. Styles apply from the breakpoint & up.

Target viewport sizes with breakpoint prefixes.

sm:bo-*
Small640px
md:bo-*
Medium768px
lg:bo-*
Large1024px
xxl:bo-*
Extra Large1536px

Hover State

Apply styles conditionally on hover using the h: prefix.

Add the h: prefix to apply styles only when the user hovers over the element.

Syntax:h:bo-*