I have three images vertically aligned inside of a div. When the browser shrinks the third image no longer fits within the div causing that image to drop down to the second line. I used auto and 100% width and height properties in CSS but it doesn't keep the images inline nor resize the image. Anyone know how to fix this?
<div class="media">
<img class="media_image" src="source1_name">
<p>Some text that overlays the image</p>
</div>
<div class="media">
<img class="media_image" src="source2_name">
<p>Some text that overlays the image</p>
</div>
<div class="media">
<img class="media_image" src="source3_name">
<p>Some text that overlays the image</p>
</div>
.media {
display: inline-block;
position: relative;
vertical-align: top;
margin-left: 16px;
}
.media img {
width: auto;
height: auto;
}
.media_image {
display: block;
}