Styling the body Element


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


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




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