Adding paddingThe 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> Elementbody { 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.
|