Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

Always set width and height for the IMG tag

Vote:
 

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".

#34595
Nov 10, 2009 13:48
Vote:
 

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.

#85881
May 08, 2014 0:34
Vote:
 

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 :)

#173198
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.