What do you call tags that need no ending tag?

后端 未结 13 1501
旧时难觅i
旧时难觅i 2020-12-13 00:12

There are HTML tags, such as , and

13条回答
  •  渐次进展
    2020-12-13 00:18

    This syntax has a variety of names depending on what language you are using. The best way to find out what it is called is to look at the specification for the specific language.

    HTML 4.x

    I can't find any mention of this syntax in the HTML 4.x specification. It is not valid syntax.

    HTML 5

    In the HTML 5 specification the / character (called a SOLIDUS) is valid but has no effect for void elements such as
    ,


    , , , etc. and for foreign elements (such as SVG tags) it designates a start tag that is marked as self-closing. It is not a valid syntax for all other tags (such as
提交回复
热议问题