Is it a good idea / practice to specify the unit of measurement on img elements in html markup?
I’ve always done, and thought yes. I assume it avoids browser from guessing either % to px?
Maybe I am wrong here, and it’s quicker, more efficient, and suggested, to simply specify numeral value without trailing UOM.
I’ve read through the W3C, and found nothing specific to my question.
<img src="/path/to/image/thegood.jpg" width="100px" height="100px" />
vs.
<img src="/path/to/image/andthebad.jpg" width="100" height="100" />
The spec specifically states the length without a percent indicates pixels.