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
Complete CSS Reference
| WEB HOSTING |
|---|
| Best Web Hosting |
| PHP MySQL Hosting |
| Best Hosting Coupons |
| UK Reseller Hosting |
| Cloud Hosting |
| Top Web Hosting |
| $3.98 Unlimited Hosting |
| Premium Website Design |
| WEB BUILDING |
|---|
| Download XML Editor |
| FREE Website BUILDER |
| Best Website Templates Top CSS Templates |
| CREATE HTML Websites |
| EASY WEBSITE BUILDER |
| W3SCHOOLS EXAMS |
|---|
|
Get Certified in: HTML, CSS, JavaScript, XML, PHP, and ASP |
| W3SCHOOLS BOOKS |
|---|
|
New Books: HTML, CSS JavaScript, and Ajax |
| STATISTICS |
|---|
|
Browser Statistics Browser OS Browser Display |
| SHARE THIS PAGE |
|---|