Setting Background Images
In HTML, the BODY element's BACKGROUND attribute is used to set a background image for a page. That attribute has been deprecated in HTML 4 and XHTML 1 in favor of using styles to achieve the same or better results. In CSS, the background-image property is used to specify an element to be displayed in an element's background. I've included a background image, paper.gif, with the example files that you can use to try this out, although you can substitute any lighter colored background image you want to use. To apply a background image to your page, edit your style sheet codes as shown here (see Figure 6.7):
body { color: rgb(153,0,0); background-color: rgb(255,255,204); background-image: url("paper.gif"); }
Figure 6.7. ...
Get Cascading Style Sheets (CSS) by Example 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.