Adding background-imageThe background-image property is used to add a background image to the <body> element. Values for the background-image property are either a url (to specify the image) or none (when no image is used). For this lesson, you will use url(chapter6.jpg). The image path can be written with or without quotation marks. The background-image code is shown in Listing 6.3. The results can be seen in Figure 6.1. Listing 6.3. CSS Code Styling the <body> Element with a Background Imagebody { background-image: url(chapter6.jpg); } Figure 6.1. Screenshot of styled <body>.
|