Reputation: 19
I got this code from css-tricks.com but it doesn't seem to work properly. Can any one tell me how to use this.
<picture alt="description">
<source src="small.jpg">
<source src="medium.jpg" media="(min-width: 400px)">
<source src="large.jpg" media="(min-width: 800px)">
</picture>
my code
<div class="col-sm-6 col-md-4">
<picture alt="description">
<source src="images/office-room.jpg">
<source src="medium.jpg" media="(min-width: 400px)">
<source src="large.jpg" media="(min-width: 800px)">
</picture>
</div>
Upvotes: 0
Views: 71
Reputation: 3429
plz refer this one:
<style>
.fixed-ratio-resize { /* basic responsive img */
max-width: 100%;
height: auto;
width: auto\9; /* IE8 */
}
</style>
<img class="fixed-ratio-resize" src="students.jpg" alt=""/>
Upvotes: 1
Reputation: 207
looks like your using bootstrap with the col-sm-4 class
if so then you should just add this class to the image img-responsive
http://getbootstrap.com/css/#images
so
<div class="col-sm-6 col-md-4">
<img class="img-responsive" src="images/office-room.jpg">
</div>
Upvotes: 0