Tutorials

CSS 'background-origin' Property Explained

  • Published
  • 2 min read
  • CSS
  • HTML
  • Web Design
CSS 'background-origin' Property Explained
In this article
  1. CSS 'background-origin' Property Examples
  2. Browser Support For 'background-origin' Property
  3. CSS Syntax of the 'background-origin' Property
  4. Usage of the 'background-origin' Property
  5. Property Values of the 'background-origin' Property

Corrected . Background-origin now described as the positioning reference, with painting controlled separately by background-clip (checked against MDN). The browser-support table was also rebuilt from MDN browser-compat-data. Editorial approval is still pending.

The CSS 'background-origin' property specifies the origin position of the background image(s). The origin is the initial positioning area of the background images before they are placed and sized according to background position and background size. Essentially, it determines which part of the box model (the border box, padding box, or content box) is the positioning reference for the background image. It does not decide where the background is painted or cut off: that is the job of background-clip.

CSS 'background-origin' Property Examples

See the Pen CSS 'background-origin' Property by Webzstore (@webzstore) on CodePen.

The 'background-origin' property offers significant flexibility in how background images are integrated into an element's overall design, allowing for nuanced control over their positioning and presentation in relation to the box model.

Origin versus clipping: background-origin only sets the reference box used for background-position and for sizing percentages. Where the background is actually painted, and where it is cut off, is controlled separately by background-clip, whose initial value is border-box. For example, with background-origin: content-box and the default background-clip, a non-repeating image starts at the content edge, while a repeating image can still tile into the padding and under the border. Per MDN, background-origin is ignored when background-attachment is fixed.

.card {
  border: 10px dashed #333;
  padding: 20px;
  background-image: url("pattern.png");
  background-repeat: no-repeat;
  background-origin: content-box; /* image starts at the content edge */
  background-clip: border-box;    /* paint area is unchanged (the default) */
}

Browser Support For 'background-origin' Property

Unprefixed support for the background-origin property (selected supported implementation, desktop browsers)
BrowserVersionReleased
Chrome1Dec 2008
Edge12Jul 2015
Firefox4Mar 2011
Safari3Oct 2007
Opera10.5Mar 2010

Source: MDN browser-compat-data 8.1.4, checked 3 October 2026. Prefixed support and implementations that were later removed are not counted, and some browsers list partial support or extra values. See the MDN reference for background-origin for the full compatibility details, including mobile browsers.

CSS Syntax of the 'background-origin' Property

background-origin: border-box | padding-box | content-box | initial | inherit;

Usage of the 'background-origin' Property

Use 'background-origin' when you need precise control over where your background images begin within an element's box. It's particularly useful in designs where the background needs to align tightly with the content, padding, or border areas, affecting how backgrounds integrate with the page's overall layout and visual hierarchy.

Property Values of the 'background-origin' Property

  • Border-box: The background image is positioned relative to the border box, so its origin is the outer edge of the border.
  • Padding-box: The background image is positioned relative to the padding box, so its origin is the outer edge of the padding (the inner edge of the border). This is the initial value.
  • Content-box: The background image is positioned relative to the content box, so its origin is the inner edge of the padding.
  • Initial: Sets the property to its initial value, padding-box, resetting any earlier declaration.
  • Inherit: Inherits the background-origin property from the element's parent, ensuring consistency within nested elements.

Share this article

Written by

Webzstore Team

Webzstore has helped businesses since 2010. Today, we bring websites, digital marketing and enquiry follow-up into practical plans built around the work each business needs.

Related services

Talk about your website or marketing

Book a Free 30-Minute Call

More tutorials

All tutorials

Privacy choices

Choose what this website may load. Your choice is saved on this device for up to 180 days. Privacy Policy

Turning a choice off stops further use of that optional service on this site. It does not take back information already sent, and we cannot delete cookies that other services set in your browser.