<input>和<input/>哪种写法正确?
<input>和<input/>哪种写法正确?
<input>和<input/>哪种写法正确?
2021-03-20
和版本有关,不过html5官方文档推荐空标签更推荐使用<input>这样的方式
Void elements only have a start tag;
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) character. This character has no effect on void elements, but on foreign elements it marks the start tag as self-closing.
Void elements: area, base, br, col, embed, hr, img, input, keygen, link, meta, param, source, track, wbr
举报