0
0
CSSmarkup~20 mins

Background repeat in CSS - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Background Repeat Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What does background-repeat: no-repeat; do?
If you apply background-repeat: no-repeat; to an element with a background image, what will happen?
AThe background image will appear only once and not repeat.
BThe background image will repeat horizontally only.
CThe background image will repeat vertically only.
DThe background image will repeat both horizontally and vertically.
Attempts:
2 left
💡 Hint
Think about what 'no-repeat' means in everyday language.
📝 Syntax
intermediate
2:00remaining
Which CSS rule correctly repeats a background image horizontally only?
Choose the CSS rule that makes the background image repeat only from left to right, but not up and down.
Abackground-repeat: repeat;
Bbackground-repeat: repeat-y;
Cbackground-repeat: repeat-x;
Dbackground-repeat: no-repeat;
Attempts:
2 left
💡 Hint
The 'x' in 'repeat-x' hints at horizontal direction.
rendering
advanced
2:30remaining
What will you see with this CSS snippet?
Given this CSS:
div {
  width: 200px;
  height: 100px;
  background-image: url('pattern.png');
  background-repeat: repeat-y;
}

What is the visual effect on the div's background?
CSS
div {
  width: 200px;
  height: 100px;
  background-image: url('pattern.png');
  background-repeat: repeat-y;
}
AThe background image repeats both horizontally and vertically.
BThe background image repeats horizontally only, side by side.
CThe background image appears once, no repetition.
DThe background image repeats vertically only, stacking top to bottom.
Attempts:
2 left
💡 Hint
Think about the 'y' in 'repeat-y'.
selector
advanced
2:30remaining
Which CSS selector applies background-repeat only to paragraphs inside a section?
You want to apply background-repeat: no-repeat; only to <p> elements inside a <section>. Which selector is correct?
Asection p { background-repeat: no-repeat; }
Bp section { background-repeat: no-repeat; }
Csection > p { background-repeat: repeat; }
Dp > section { background-repeat: no-repeat; }
Attempts:
2 left
💡 Hint
Think about the order of parent and child in selectors.
accessibility
expert
3:00remaining
Why should you be careful using background-repeat with important content images?
If you use a background image with background-repeat: repeat; that contains important information, what accessibility issue might occur?
ARepeated background images improve keyboard navigation for users.
BScreen readers cannot read background images, so repeated images may confuse users relying on assistive technology.
CBackground images with repeat always increase page load speed.
DRepeated background images automatically add alt text for screen readers.
Attempts:
2 left
💡 Hint
Think about how screen readers treat background images.