Self-closing tags (void elements) in HTML5

前端 未结 5 414
不知归路
不知归路 2020-11-28 12:10

Step 6 of 8.1.2.1 Start tags of the HTML5 spec says that void elements may have a single / character. I think this is so it\'s easier to migrate sites

5条回答
  •  攒了一身酷
    2020-11-28 12:25

    This article explains the difference between the two versions: http://www.colorglare.com/2014/02/03/to-close-or-not-to-close.html

    The two versions are completely identical.

    Actually, one might argue that adding "/` to a void tag is an ignored syntax error.

提交回复
热议问题