 <p>If its specifically an image element rather than a background-image property you want to be resized, you need to determine the proportions then assign the relative class to fit the screen</p> <pre><code>$(window).load(function() { $('.container').find('img').each(function() { var imgClass = (this.width / this.height &gt; 1) ? 'wide' : 'tall'; $(this).addClass(imgClass); }) }) </code></pre> <p>see <a href="http://jsfiddle.net/sjmcpherso/vhotnp1x/" rel="nofollow">http://jsfiddle.net/sjmcpherso/vhotnp1x/</a></p>