Always set width and height for the IMG tag


Is there a way that all images that are added gets the width and height set on the img tag? When I publish a page now there is no width/height set unless I set it by myself by selecting "Fler inställningar" and "Lås höjd/bredd-förhållande" in the "Bildredigerare".

Nov 10, 2009 13:48

You should never use the width and height properties since they do not change the actual size of the image. Instead it zoom the image. If you need to be able to change the height of an image you should create a new copy of that image.

Ask your developer to create a better solution for adding images to your website.

May 08, 2014 0:34

Actually, if you want to use "double-resolution" images so your images look good on Retina displays (such as the iPhone or iPad) then you do need to set the image height and width. The artificially-set height and width would be half of the image's actual size (so a 50px x 50px image would have height="25" and width="25"). If you don't do this, your images will look blurry on Retina displays.

As a developer, I would prefer to use smaller, actual-size images and not "pay the Retina tax" in terms of download size, but our designer wants it to look pretty on Apples :)

Dec 15, 2016 22:28
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.