background
Allows you to set multiple background-related properties at once. Values are separated by spaces and can be specified in any order.
Sample Code
background: #fff url(./img/sample_bg.png) 50% 50%;
Browser Preview
<p style="background: url(/dics/dictionary-css/img/sample_bg.png) 50% 50% #fff;">Specifying a background color and a background image at 50% size.</p>
Available Properties (CSS 3)
| Property | Description |
|---|---|
| background-attachment | Sets whether the background image scrolls with the page or is fixed. |
| background-clip | Sets the display area of the background image. |
| background-color | Sets the background color. |
| background-image | Sets the background image. |
| background-origin | Sets the reference position for the background image. |
| background-position | Sets the position of the background image. |
| background-repeat | Sets the repeat direction of the background image. |
| background-size | Sets the size of the background image. |
Available Properties (CSS 2)
| Property | Description |
|---|---|
| background-attachment | Sets whether the background image scrolls with the page or is fixed. |
| background-color | Sets the background color. |
| background-image | Sets the background image. |
| background-position | Sets the position of the background image. |
| background-repeat | Sets the repeat direction of the background image. |
Notes
You can set multiple background-related properties at once. The order of values does not matter. Values are separated by spaces.
The『background』property is supported by all browsers, but the available values differ between browsers that support CSS3 and those that only support up to CSS2. For details on browser support for each value, please refer to the individual property pages.
If you find any errors or copyright issues, please contact us.