Easy Tutorial
❮ Prop Input Time Name Dom Obj Blockquote ❯

backgroundOrigin Property

Style Object

Example

Position the background image relative to the content box:


Definition and Usage

The backgroundOrigin property sets or returns what the background-position property is relative to.

Note: This property has no effect if the background-attachment property is "fixed".


Browser Support

IE9+, Firefox, Opera, Chrome, and Safari support the background-origin property.


Syntax

Return the backgroundOrigin property:

Set the backgroundOrigin property:

Property Values

Value Description
padding-box Default value. The background image is positioned relative to the padding box.
border-box The background image is positioned relative to the border box.
content-box The background image is positioned relative to the content box.
initial Sets this property to its default value. See initial
inherit Inherits this property from its parent element. See inherit

Technical Details

Default value: padding-box
Return value: A string, representing the background-origin property of the element.
--- ---
CSS version CSS3
--- ---

Related Articles

CSS Reference: background-origin Property


Style Object

❮ Prop Input Time Name Dom Obj Blockquote ❯