Position the background image relative to the content box:
![]()
The background-origin property is supported in IE9+, Firefox 4+, Opera, Chrome, and Safari 5+.
The background-origin property specifies what the background-position property should be relative to.
Note: If the background-attachment property for the background image is "fixed", this property has no effect.
| Default value: | padding-box |
|---|---|
| Inherited: | no |
| Version: | CSS3 |
| JavaScript syntax: | object.style.backgroundOrigin="content-box" |
| Value | Description | Play it |
|---|---|---|
| padding-box | The background image is positioned relative to the padding box | Play it » |
| border-box | The background image is positioned relative to the border box | Play it » |
| content-box | The background image is positioned relative to the content box | Play it » |
CSS3 tutorial: CSS3 Backgrounds
Your message has been sent to W3Schools.