Search code examples
htmlimagedefaultcss

Why does image use display: inline but behaves like an inline-block element


Why is the default display style for image inline instead of inline-block?

Is there any difference between inline and inline-block for img elements, from what I can see it behaves exactly in the same way.


Solution

  • The default browser stylesheets were initially created using CSS1 for HTML3.2, so inline-block was not available or necessary. There's no difference between them for image elements.

    References