Recall & Review
beginner
What CSS property is used to set a background image on an element?
The
background-image property is used to set a background image on an element.Click to reveal answer
beginner
How do you make a background image cover the entire element without repeating?
Use
background-size: cover; to make the image cover the whole element and background-repeat: no-repeat; to prevent repeating.Click to reveal answer
beginner
What does
background-position: center; do?It centers the background image horizontally and vertically inside the element.
Click to reveal answer
intermediate
How can you make a background image stay fixed when scrolling the page?
Use
background-attachment: fixed; to keep the background image fixed in place while the content scrolls.Click to reveal answer
intermediate
Why should you use semantic HTML elements with background images?
Semantic elements like
<section> or <article> help screen readers and improve accessibility, even if a background image is decorative.Click to reveal answer
Which CSS property sets the image used as a background?
✗ Incorrect
The correct property to set a background image is
background-image.How do you prevent a background image from repeating?
✗ Incorrect
Use
background-repeat: no-repeat; to stop the image from repeating.What does
background-size: cover; do?✗ Incorrect
cover scales the image to fill the element fully, cropping parts if necessary.Which property keeps the background image fixed when scrolling?
✗ Incorrect
background-attachment: fixed; keeps the background image in place during scrolling.Why is it important to use semantic HTML with background images?
✗ Incorrect
Semantic HTML helps assistive technologies understand the page structure, improving accessibility.
Explain how to add a background image to a webpage and make sure it covers the entire area without repeating.
Think about how to make the image fill the space nicely and not repeat.
You got /4 concepts.
Describe how to keep a background image fixed in place while the user scrolls the page.
This property controls if the background moves with the page or stays still.
You got /2 concepts.