The background-image property lets you set an image as the background for an element.
This property has two values:
To specify an image as a background, enter the URL of the image as the <url> value. When specifying an image as the background, you should also specify a color (by using the background-color property). When the document is displayed, the image overlays the color. You should do this for several reasons:
The following rule specifies both an image and a color for the background. Figure 10.6 shows the result. Figure 10.6. Setting both an image and a color as the background of an element.
P { background-image: url(ball.gif); background-color: #FFAA00; } |