CSS background-image
The background-image property specifies an image to use as the background of an element.
By default, the image is repeated so it covers the entire element.
Example
Formatted code
body {
background-image: url("paper.gif");
}Live preview
Example
Formatted code
body {
background-image: url("bgdesert.jpg");
}Live preview
Note
When using a background image, use an image that does not disturb the text.
The background image can also be set for specific elements, like the <p> element:
Example
Formatted code
p {
background-image: url("paper.gif");
}Live preview
The CSS Background Image Property
| Property | Description |
|---|---|
| background-image | Sets the background image for an element |