HTML 5: Is it
,
, or
?

后端 未结 29 3335
滥情空心
滥情空心 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:42


    is sufficient but in XHTML
    is preferred according to the WHATWG and according to the W3C.

    To quote Section 8.1.2.1 of HTML 5.2 W3C Recommendation, 14 December 2017

    Start tags must have the following format:

    1. After the attributes, or after the tag name if there are no attributes, there may be one or more space characters. (Some attributes are required to be followed by a space. See §8.1.2.3 Attributes below.)

    2. Then, if the element is one of the void elements, or if the element is a foreign element, then there may be a single U+002F SOLIDUS character (/). This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.

    If you use Dreamweaver CS6, then it will autocomplete as
    .

    To validate your HTML file on W3C see : http://validator.w3.org/

提交回复
热议问题