rembrembdocs

background-origin

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

ClassStyles
bg-origin-border
background-origin: border-box;

| | bg-origin-padding |

background-origin: padding-box;

| | bg-origin-content |

background-origin: content-box;

|

Use the bg-origin-border, bg-origin-padding, and bg-origin-content utilities to control where an element's background is rendered:

bg-origin-border

bg-origin-padding

bg-origin-content

<div class="border-4 bg-[url(/img/mountains.jpg)] bg-origin-border p-3 ..."></div><div class="border-4 bg-[url(/img/mountains.jpg)] bg-origin-padding p-3 ..."></div><div class="border-4 bg-[url(/img/mountains.jpg)] bg-origin-content p-3 ..."></div>

Prefix a background-origin utility with a breakpoint variant like md: to only apply the utility at medium screen sizes and above:

<div class="bg-origin-border md:bg-origin-padding ...">  <!-- ... --></div>

Learn more about using variants in the variants documentation.

On this page

[

Refactoring UI

From the creators of Tailwind CSS

Make your ideas look awesome, without relying on a designer.

“This is the survival kit I wish I had when I started building apps.”

Derrick Reimer, SavvyCal

](https://www.refactoringui.com/?ref=sidebar)

Copyright © 2026 Tailwind Labs Inc.·Trademark Policy