Recall & Review
beginner
What does the CSS
background-position property do?It sets the starting position of a background image inside an element. You can move the image horizontally and vertically.
Click to reveal answer
beginner
Name two units or keywords you can use with
background-position.You can use keywords like
top, center, bottom, left, right, or length units like px, %, em.Click to reveal answer
beginner
How would you center a background image using
background-position?Use
background-position: center; or background-position: 50% 50%; to place the image in the center horizontally and vertically.Click to reveal answer
beginner
What happens if you use
background-position: right bottom;?The background image will be placed at the bottom right corner of the element.
Click to reveal answer
intermediate
Can
background-position accept two values? What do they represent?Yes, it accepts two values: the first is horizontal position, the second is vertical position. For example,
background-position: 20px 30px; moves the image 20 pixels from the left and 30 pixels from the top.Click to reveal answer
Which CSS property controls where a background image starts inside an element?
✗ Incorrect
background-position sets the starting point of the background image inside the element.
What does
background-position: center; do?✗ Incorrect
It centers the background image both horizontally and vertically.
Which of these is a valid
background-position value?✗ Incorrect
center center is valid. middle middle is not a CSS keyword.
If you want the background image to start 10 pixels from the left and 20 pixels from the top, what is correct?
✗ Incorrect
The first value is horizontal (left), the second is vertical (top).
What does
background-position: right bottom; do?✗ Incorrect
It places the background image at the bottom right corner of the element.
Explain how to use the
background-position property to move a background image to the top right corner.Think about horizontal and vertical keywords.
You got /4 concepts.
Describe the difference between using percentage values and keyword values in
background-position.Consider how the image moves inside the element.
You got /3 concepts.