I am trying to get responsive images working and I have this layout so far...
.container {
display:flex;
max-width:1000px
}
.col1 {
flex:1;
background:teal;
text-align:center;
}
.col2 {
flex:1;
background:wheat;
text-align:center;
}
.img-responsive {
max-width:100%;
height:auto;
}
<div class="container">
<div class="col1">
This is column 1
<img
class="img-responsive"
src="https://dummyimage.com/1000x1000/000/fff"
srcset="https://dummyimage.com/1000x1000/000/fff 1000w,
https://dummyimage.com/750x750/000/fff 750w,
https://dummyimage.com/400x400/000/fff 400w"
sizes="(max-width: 1000px) 1000px,
(max-width: 7500px) 750px,
(max-width: 400px) 400px,
1024px"
">
</div>
<div class="col2">
This is column 2
</div>
</div>
I am expecting the 1000px image to be displayed when the screen is 1000px and above, the 750px version at 750px and above and so on...
But it only ever gives me the large version, where am I going wrong?