Adding padding


Adding padding

The final step will be to add padding to the <body> element to push the text away from the background-image. This can be achieved using the shorthand padding declaration padding: 1em 80px 1em 1em; as shown in Listing 6.7. This will place 1em of padding on the top, bottom, and left of the <body> and 80px on the right edge. The results can be seen in Figure 6.4.

Listing 6.7. CSS Code Adding padding to the <body> Element
body {     background: url(chapter6.jpg) repeat-y 100% 0;     margin: 0;     padding: 1em 80px 1em 1em; } 

Figure 6.4. Screenshot of <body> element with padding applied.





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