Image Size Definition
Posted: Tue May 14, 2013 9:36 pm
Are there any disadvantages of not defining the width and height of an image withing an <img> tag apart from making the browser waste cycles working out how big the image should be? I am using CSS to set a maximum width and height, within a custom <div> tag. I am doing this in order to make the site design responsive, i.e. the page displays correctly for the size of screen you're viewing it on and yet only having the one version of the image, The code I currently have is
#container img {max-width: 100%; max-height: 100%;}Is there a better way to do this?