HTML 5: Is it
,
, or
?

后端 未结 29 3785
滥情空心
滥情空心 2020-11-22 00:26

I\'ve tried checking other answers, but I\'m still confused — especially after seeing W3schools HTML 5 reference.

I thought HTML 4.01 was supposed to \"allow\" singl

29条回答
  •  没有蜡笔的小新
    2020-11-22 00:45

    Both
    and
    will do fine but I prefer
    because it's slightly more logical. It is logical to expect a closing tag whenever there is an opening tag. Therefore your code is slightly easier to read if you don't use an opening tag when there isn't going to be a closing tag.

    All browser (except possibly some very old ones that don't matter) will display both exactly the same. However,
    is not xHTML complient.

提交回复
热议问题