Recall & Review
beginner
What does it mean for an image to be responsive in web design?
A responsive image automatically adjusts its size to fit the screen or container it is in, so it looks good on all devices like phones, tablets, and desktops.
Click to reveal answer
beginner
Which Bootstrap class makes an image responsive?The <code>.img-fluid</code> class in Bootstrap makes an image scale nicely to the parent container by setting <code>max-width: 100%</code> and <code>height: auto</code>.Click to reveal answer
beginner
Why should you use
alt attributes with images?The
alt attribute provides alternative text for images. It helps screen readers describe the image to visually impaired users and improves accessibility.Click to reveal answer
intermediate
How does the
srcset attribute help with responsive images?The
srcset attribute lets the browser choose the best image size to load based on the device's screen size and resolution, saving bandwidth and improving load speed.Click to reveal answer
intermediate
What CSS properties does Bootstrap's <code>.img-fluid</code> class use to make images responsive?It uses
max-width: 100% to limit the image width to its container and height: auto to keep the image's aspect ratio.Click to reveal answer
Which Bootstrap class should you add to an
<img> tag to make it responsive?✗ Incorrect
Bootstrap uses the class
.img-fluid to make images scale responsively.What does the CSS property
max-width: 100% do for an image?✗ Incorrect
max-width: 100% limits the image width to the container's width, preventing overflow.Why is it important to include the
alt attribute on images?✗ Incorrect
The
alt attribute provides text for screen readers, helping users who cannot see the image.What does the
srcset attribute do in an <img> tag?✗ Incorrect
srcset allows the browser to pick the best image size based on device resolution and screen size.If an image has
height: auto in CSS, what happens?✗ Incorrect
height: auto keeps the image's aspect ratio when the width changes.Explain how to make an image responsive using Bootstrap classes and why it is important.
Think about how images behave on phones versus desktops.
You got /4 concepts.
Describe the role of the
alt attribute and the srcset attribute in responsive images.One helps people, the other helps devices.
You got /4 concepts.