O'Reilly logo

Web Programming with HTML5, CSS, and JavaScript by Dean

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required