<img src=”image.png” alt=”image description” width=”100” height=”70”>
The width and height attributes are used to tell the browser what size we would like to display the image. The values used are in pixel format. It is important to note that specifying both width and height attributes will force the image into the specified aspect ratio. Therefore, if the image ratio is different from the original image, the image may look squashed or bloated. So it is common to just specify either width or height alone, which sets the size of the specified dimension and leaves the other to automatically scale as per the image’s natural aspect ratio. For example, specifying a width of 100 pixels would allow the height of the image to automatically scale to the correct height to honour the image’s aspect ratio.