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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.