Styling the <h2> ElementTo 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 Alignmenth1#header { color: #036; font: bold 100% arial, helvetica, sans-serif; text-align: center; } Figure 9.1. Screenshot of styled heading.
|