vs
in clearing

后端 未结 12 1429
醉话见心
醉话见心 2021-02-02 10:47

What is the difference


vs

??

Al

12条回答
  •  难免孤独
    2021-02-02 11:16

    The difference is which other style attributes you inherit. Of course one inherits from
    and the other from

    .

    Typically

    has no special style implications other than display:block whereas
    implies a line-break and some non-zero height (linked to the current font height).

    But often (e.g. with the ubiquitous css-reset technique) there is approximentally no difference. Therefore, pick the one that makes the most semantic sense.

    [UPDATE]

    For closing tags, use

    and not
    . Here's why.

    Thanks to commentors Sebastian Celis and ephemient for the "closing tag" correction.

提交回复
热议问题