Is

前端 未结 6 2204
一向
一向 2020-11-22 17:16

I\'ve read somewhere that element behaves like both. If correct, could someone please explain with examples?

6条回答
  •  傲寒
    傲寒 (楼主)
    2020-11-22 18:02

    An img element is a replaced inline element.

    It behaves like an inline element (because it is), but some generalizations about inline elements do not apply to img elements.

    e.g.

    Generalization: "Width does not apply to inline elements"

    What the spec actually says: "Applies to: all elements but non-replaced inline elements, table rows, and row groups "

    Since an image is a replaced inline element, it does apply.

提交回复
热议问题