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

前端 未结 6 800
醉话见心
醉话见心 2021-01-06 01:02

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

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-06 01:19

    Inline-block allows you to manipulate the object's appearance with box-model styling (such as giving it dimensions), but allows you to keep the object aligned inline, like text.

提交回复
热议问题