Приглашаем посетить
Романтизм (19v-euro-lit.niv.ru)

Styling the <body> Element

Previous Page
Table of Contents
Next Page

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>.

Styling the <body> Element


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;
}


Previous Page
Table of Contents
Next Page