Styling the h2 Element


Styling the <h2> Element

To add a color to the <h2> element, use the color property. The color can be changed to suit your needs.

The font weight, size, and family are set using the font property, and the heading is centered using the text-align property as shown in Listing 9.3 and illustrated in Figure 9.1.

Listing 9.3. CSS Code Setting Text Alignment
h1#header {     color: #036;     font: bold 100% arial, helvetica, sans-serif;     text-align: center; } 

Figure 9.1. Screenshot of styled heading.





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