HTML & CSS · Junior · Question 67 of 75
Why is img { max-width: 100%; height: auto; } a common base rule?
- ✓Correct answer: Images shrink to fit narrow containers while keeping their aspect ratio
- 2It makes images load faster
- 3It forces images to always fill the full width
Explanation
Without it, a large image overflows a mobile layout. max-width (not width) prevents small images from being stretched.