Property Description
The background-origin property specifies what the background-position property should be relative to.
This property has the following syntax:
background-origin: border-box|padding-box|content-box|initial|inherit;
Property Values
Value | Description |
---|---|
border-box | The background image is positioned relative to the border box |
padding-box | (default) The background image is positioned relative to the padding box |
content-box | The background image is positioned relative to the content box |
initial | Specifies that the value of the property should be set to the default value |
inherit | Specifies that the value of the property should be inherited from the parent element |
Examples
This example shows how to the painting area of the background:
div {
background-image: url('smiley.gif');
background-repeat: no-repeat;
background-position: left;
background-origin: content-box;
}
Browser Support
Chrome | Firefox | IE | Safari | Opera |
---|---|---|---|---|
4.0 | 4.0 | 9.0 | 3.0 | 10.5 |
Miscellaneous Information
Inherited: | No |
---|---|
Defined In: | CSS3 |
Default Value: | padding-box |