8. Backgrounds and Borders

Through the color and images of backgrounds and borders, a site’s owner or creator can transform bland pages of text into designs that convey a mood, aesthetic, and branding. That is asking a lot of just two seemingly simple properties, but as you’ll see throughout this chapter, they’re very flexible and powerful properties.

Backgrounds

Backgrounds are an integral part of styling an HTML document. Solid colors, patterns, tiles, gradients, unconventional borders, and nonrectangular shapes can all be achieved by applying the various background properties to the right element.

background-color

The background-color property is applied throughout the content area of the element and is drawn behind any background-image ...

Get The CSS Pocket Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.