← Quiz: Responsive Design: all 10 questions
Quiz: Responsive Design · Question 2 of 10
Which CSS keeps images from overflowing their container?
Which CSS keeps images from overflowing their container?
- A.img { width: 1000px; }
- B.img { max-width: 100%; height: auto; }
- C.img { overflow: hidden; }
- D.img { display: none; }
Answer & explanation
Correct answer: img { max-width: 100%; height: auto; }
max-width: 100% lets images shrink to fit.
Can you get the rest right without peeking?
Take the timed Quiz: Responsive Design quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →