Language
日本語
English

Caution

JavaScript is disabled in your browser.
This site uses JavaScript for features such as search.
For the best experience, please enable JavaScript before browsing this site.

CSS Dictionary

  1. Home
  2. CSS Dictionary
  3. background

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)

PropertyDescription
background-attachmentSets whether the background image scrolls with the page or is fixed.
background-clipSets the display area of the background image.
background-colorSets the background color.
background-imageSets the background image.
background-originSets the reference position for the background image.
background-positionSets the position of the background image.
background-repeatSets the repeat direction of the background image.
background-sizeSets the size of the background image.

Available Properties (CSS 2)

PropertyDescription
background-attachmentSets whether the background image scrolls with the page or is fixed.
background-colorSets the background color.
background-imageSets the background image.
background-positionSets the position of the background image.
background-repeatSets 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 .