HTML and CSS Reference
In-Depth Information
Note CSS 3 provides a selector that allows for this sort of thing. However, no major browser currently
supports it:
tr:nth-child(odd) {
background-color: #dfdfdf
Styling the Caption
Early in the chapter, we added the caption element to our table. By default, it will appear
above your table. However, CSS offers a property, caption-side , which positions the caption
on the top, bottom, left, or right of the table. Let's position our caption at the bottom of the
table, and give it some additional style as well:
caption {
caption-side: bottom;
line-height: 4em;
font-family: Georgia, "Times New Roman", serif;
font-size: .85em;
font-style: italic;
This gives us the result shown in Figure 10-9.
Figure 10-9. Styling our table caption effectively
Search WWH ::

Custom Search