• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

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;
}


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint