css - Responsive images, scale down only -
i'm trying work out how make images responsive scale down only, solutions have found far use max-width:100%
or max-width:??px
these stretch image parent container , that's not result i'm after.
i have jquery fix:
var ww = $(window).width(), iw = $('img').width(); if(ww < iw) { $('img').css('width',ww - 20); }
but css solution.
so have image 640px width if browser window wider 640px image should remain 640px wide , not stretched fit parent container, if browser window smaller , should image responsive fit inside browser window.
Comments
Post a Comment