css background shorthand code example

Example 1: background css property shorthand

background: bg-color bg-image position/bg-size bg-repeat bg-origin bg-clip bg-attachment initial|inherit;

Example 2: background css

/* Color (Example: red): */
html,body {
  background-color: red;
}

/* Image (Example: your.picture): */
html,body {
  background-image: url("your.picture");
}

Example 3: background css

body {
  background: #ffffff url("img_tree.png") no-repeat fixed right top;
}

Example 4: background single line property css

body {
  background: #ffffff url("img_tree.png") no-repeat right top;
}

Tags:

Css Example