Changing the Background
Changing the background
To change a
Within the desired tag, type
Figure 16.35. You can add the bgcolor attribute to any part of the table. Here I've matched the background of the logo bar to the color of the middle image so that it looks like it stretches with the browser window. And I've added a dark green background to the left navigation bar.
To change a cell's background image or color with CSS: In the desired rule, type background: value , where value is described in detail on pages pages 172173.
Figure 16.36. At left, you can see the yellow background around and between the images in the logo bar. Notice (above) that the green background also
|
Controlling the Space
(X)HTML has long had two attributes for the table tag that allow it to control spacing between the contents of a
Figure 16.39. Cell spacing adds space between cells. Cell padding adds space between a cell's contents and its border.
CSS on the other hand lets you use the now familiar padding property (see page 177) to control space on every side of a cell, as well as between paragraphs and other elements. It is a welcome substitute for cellpadding . Figure 16.40. I have set both the cellpadding and cellspacing to zero so that there is no extra space around or between the cells of my logo bar (and other elements).
Unfortunately, although the CSS property for controlling cellspacing (
Figure 16.41. The extra spaces between the cells disappear (
|