🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.img { width: 1000px; }
  2. B.img { max-width: 100%; height: auto; }
  3. C.img { overflow: hidden; }
  4. 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 →