Everyone knows that the img tag is an inline element, and inline elements do not have height and width by default. So the question is, why does setting the height and width of img take effect by default?
By default it can be set like this
I?? went through the w3c rules?
Original text: http://www.w3.org/TR/html-markup/img.html
It is mentioned below
Typical default display properties
img {display: inline-block; }
If the img does not set the width and height, the default width and height will be the size of the loaded image. Setting After changing the width and height, the image will be stretched/compressed accordingly.
It should be the particularity of img, which requires processing of the image, so setting the width and height of this tag is effective