Background

CSS background images are one of the most common places that I see CSS shorthand being implemented. There might be a little more functionality here though than people take advantage of. Let’s start with a typical example of the normal way to declare a background.

Background: The Long Way

1
2
3
background-color: #eee;
background-image: url(background.jpg);
background-repeat: no-repeat;