Styling the Caption


An unstyled table caption will be displayed above the table. On most modern browsers the caption will be center aligned, but you can change the default caption alignment using text-align: left.

To increase the space between the caption and its table, margin-bottom can be set to .5em.

The caption also can be given more weight to make it stand out from the table content. This is achieved using font-weight:bold as shown in Listing 14.9. The results can be seen in Figure 14.1.

Listing 14.9. CSS Code for Styling the Caption
caption {     text-align: left;     margin: 0 0 .5em 0;     font-weight: bold; } 

Figure 14.1. Screenshot of styled caption.





Sams Teach Yourself CSS in 10 Minutes
Sams Teach Yourself CSS in 10 Minutes
ISBN: 0672327457
EAN: 2147483647
Year: 2005
Pages: 234
Authors: Russ Weakley

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net