10.04.2018 Views

design3

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Texture<br />

101<br />

Although repetitious background images like the ones in Figure 3.20 are the hallmark of early 1990s<br />

web design, they’re also classic examples of pattern. Pattern has long been used to add richness<br />

and visual interest to all types of design. On the Web, seamless background images were originally<br />

favored because they reduced page size and download times. Using a small image that could be<br />

tiled to fill a background area, rather than a large non-tiling image, significantly reduced the<br />

download time for website visitors with 56K modems.<br />

Figure 3.20. Typical 1990s tiling website backgrounds<br />

Just because tiling background images with repeated patterns have a tacky past, it doesn’t mean<br />

you should avoid them today. In fact, they’re used more often than you probably realize. CSS has<br />

greatly improved the degree of control designers have over the way background images work. Before<br />

CSS was around, we could only assign background images to body and table elements; now, with<br />

CSS, backgrounds can be applied to just about any element you choose. You can use any of five<br />

CSS properties (and one additional shorthand property) to set the background of an element:<br />

background-color<br />

This is the property we use to set a solid background color for any element. For example, if we<br />

wanted to set the background color of an element to a nice green-blue (00B2CC), we’d add the<br />

following declaration to the element’s style rule:<br />

background-color: #00B2CC;<br />

When using hexadecimal values in CSS, you need to prefix the color code with #, as shown<br />

above. You can also specify transparent here if you don’t want the background of your element<br />

to be filled with a color. transparent is actually the default value of the background-color<br />

property. You might be tempted to use an HTML color name, like Aquamarine or BlanchedAlmond,<br />

but as only 16 color names are officially sanctioned by the W3C in the HTML 4.0 specification<br />

(and even those will generate warnings when you try to validate your CSS), it’s recommended<br />

that you use the hexadecimal values we talked about in Chapter 2.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!