Skip to content

Backgrounds

Background Origin

Utilities for controlling how an element's background is positioned relative to borders, padding, and content.

Quick reference

ClassDescription
bg-origin-borderbackground-origin: border-box
bg-origin-paddingbackground-origin: padding-box
bg-origin-contentbackground-origin: content-box

Basic usage

Setting the background origin

Use bg-origin-border, bg-origin-padding and bg-origin-content to control where an element’s background is rendered.

bg-origin-border

Visual example of bg-origin-border

bg-origin-padding

Visual example of bg-origin-padding

bg-origin-content

Visual example of bg-origin-content
html
<div class="bg-origin-border ... "></div>
<div class="bg-origin-padding ... "></div>
<div class="bg-origin-content ... "></div>