Creating a responsive website that features a large carousel with multiple images on the homepage.
My goal is to optimize image sizes for each device so that only the necessary image is downloaded, conserving bandwidth for mobile users.
To achieve this, I plan to use Bootstrap to display different images based on the device:
<img src=" http://placehold.it/1700x700" alt="Placeholder" class="visible-lg"/>
<img src=" http://placehold.it/1100x700" alt="Placeholder" class="visible-md"/>
<img src=" http://placehold.it/900x700" alt="Placeholder" class="visible-sm"/>
<img src=" http://placehold.it/768x700" alt="Placeholder" class="visible-xs"/>
I'm wondering if, when viewed on an xs device, all four images will be downloaded or just the appropriate one. What's the best approach to ensure only the necessary images are downloaded?
Your insights and advice are greatly appreciated!