Styling the body Element


Styling the <body> Element

As discussed in Lesson 18, "Creating a Site Header," to center a container on the page, you must find ways to work around browsers that don't support auto margins. The first work-around involves applying text-align: center to the <body> element as shown in Listing 19.3. The results can be seen in Figure 19.1.

Figure 19.1. Screenshot of styled <body>.


A background-color and color also must be set on the <body> element. You can use a background color of #BOBFC2 and a color of #444.

Listing 19.3. CSS Code for Styling the Body
body {     text-align: center;     background: #B0BFC2;     color: #444; } 




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