I need to have 4 images of equal height, but variable width on one line. When the viewport gets smaller, the images have to resize accordingly and stay on one line
So something like this :
<div class="4images">
<img src="1.jpg"/>
<img src="2.jpg"/>
<img src="3.jpg"/>
<img src="4.jpg"/>
</div>
What is the best CSS to use here ?
if I use
.4images {
width:100%;
white-space: nowrap;
}
.4images img {
display:inline-block;
}
I do get the desired effect on a large screen, but when I get a smaller device, the last images go below the others... the idea is that they just would get smaller, stay in one row...
Please any hints how to accomplish this ?