7.7 Background Images

In the Halloween Sounds web page, we use a jack-o’-lantern image as the background for the web page’s body element. Specifically, we use the background-image property to specify a URL to an image file. You can see the entire Halloween Sounds web page source code in FIGURE 7.10, but we’ve copied the background-image property CSS rule here for your convenience:

body {background-image: url(../images/pumpkin.jpg);}

FIGURE 7.10 Source code for Halloween Sounds web page

The background-image property uses a URL value to specify the background image’s file. Note the URL value’s syntax—url and then parentheses around a path ...

Get Web Programming with HTML5, CSS, and JavaScript now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.