Flash cards
Review the key moves
What is the main idea behind CSS Background Image?
Lesson checks
Practice each idea before moving on
Short Mimo-style checks built from this lesson's code, terms, and sequence.
Which statement best captures the main point of this lesson?
Complete the missing token from the example code.
___-image: url("paper.gif");Put the learning moves in the order that makes the concept easiest to apply.
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
body {
background-image: url("paper.gif");
}Live preview
Example
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
p {
background-image: url("paper.gif");
}Live preview
The CSS Background Image Property
| Property | Description |
|---|---|
| background-image | Sets the background image for an element |