Challenge - 5 Problems
Background Position Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ rendering
intermediate2:00remaining
What is the visual result of this CSS background position?
Given this CSS snippet, where will the background image appear inside the box?
div {
width: 200px;
height: 200px;
background-image: url('image.png');
background-position: right bottom;
background-repeat: no-repeat;
border: 1px solid black;
}Attempts:
2 left
💡 Hint
Think about the keywords 'right' and 'bottom' in background-position.
✗ Incorrect
The background-position property sets the starting position of the background image. 'right bottom' means the image's bottom-right corner aligns with the box's bottom-right corner.
📝 Syntax
intermediate2:00remaining
Which CSS background-position value is valid?
Choose the only valid CSS background-position value from these options:
Attempts:
2 left
💡 Hint
Valid values can be keywords or two length/percentage values.
✗ Incorrect
'50% 50%' is valid and centers the background image. 'center-middle' and 'left-top' are invalid keywords. Three values are not allowed.
🧠 Conceptual
advanced2:00remaining
What happens if you use 'background-position: 150% 150%'?
If a box is 200px by 200px and the background image is 100px by 100px, what is the effect of setting
background-position: 150% 150%?Attempts:
2 left
💡 Hint
Percentages in background-position are relative to the box size.
✗ Incorrect
150% means 1.5 times the box size, so the image is placed beyond the bottom-right corner, partially or fully outside the visible area.
❓ selector
advanced2:00remaining
Which CSS selector targets elements with background-position set to 'center'?
You want to style only elements that have
background-position: center; set inline or in CSS. Which selector works?Attempts:
2 left
💡 Hint
Attribute selectors can match inline styles.
✗ Incorrect
Option A uses an attribute selector to find elements whose style attribute contains the text 'background-position: center'. Others are invalid or require classes.
❓ accessibility
expert2:00remaining
How to ensure background-position changes do not reduce accessibility?
If you use background-position to move decorative images, what should you do to keep your page accessible?
Attempts:
2 left
💡 Hint
Decorative images should be hidden from screen readers.
✗ Incorrect
Background images are decorative and not read by screen readers. Using aria-hidden="true" on the element ensures assistive tech ignores it, preventing confusion.