Приглашаем посетить
Хомяков (homyakov.lit-info.ru)

Styling the <body> Element

Previous Page
Table of Contents
Next Page

Styling the <body> Element

The <body> element will be styled with font, color,and background declarations as shown in Listing 20.9.

The font property will be used to determine the base font size and family for all elements on the page. In this example, 100% has been used because it enables the user to control the font size. A serif font has been chosen because it is more readable in print, whereas a sans-serif font is more readable on a screen or monitor (small cell phone screens in particular make serif type difficult to read). These can be changed to suit your needs.

No margins or padding have been specified for the <body> element; these will be determined by the printer. The results can be seen in Figure 20.1.

Figure 20.1. Screenshot of styled <body>.

Styling the <body> Element


Listing 20.9. CSS Code for Styling the Body
body
{
    font: 100% georgia, times, serif;
    background: #fff;
    color: #000;
}


Previous Page
Table of Contents
Next Page