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

Adding padding

Previous Page
Table of Contents
Next Page

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.

Adding padding



Previous Page
Table of Contents
Next Page