CSS Background Properties

What They Do:

Every HTML element is a box, and CSS background properties allow us to show a color or image as the background of that box.

The Syntax:

Background-Color Property

background-color: #FF0000;

Background-Image Property

background-image: url('path/to/image/file.ext');

Background-Repeat Property

background-repeat: repeat;
background-repeat: no-repeat;
background-repeat: repeat-x;
background-repeat: repeaty;

Background-Position Property

background-position: right bottom;
background-position: 5% 25%;
background-position: 5px 25px;

Background Shorthand Property

background: #0000FF url('path/to/image/file.ext') no-repeat center center;