<tfoot id='8qbEi'></tfoot>
    <legend id='8qbEi'><style id='8qbEi'><dir id='8qbEi'><q id='8qbEi'></q></dir></style></legend>
      <bdo id='8qbEi'></bdo><ul id='8qbEi'></ul>
    1. <small id='8qbEi'></small><noframes id='8qbEi'>

      1. <i id='8qbEi'><tr id='8qbEi'><dt id='8qbEi'><q id='8qbEi'><span id='8qbEi'><b id='8qbEi'><form id='8qbEi'><ins id='8qbEi'></ins><ul id='8qbEi'></ul><sub id='8qbEi'></sub></form><legend id='8qbEi'></legend><bdo id='8qbEi'><pre id='8qbEi'><center id='8qbEi'></center></pre></bdo></b><th id='8qbEi'></th></span></q></dt></tr></i><div id='8qbEi'><tfoot id='8qbEi'></tfoot><dl id='8qbEi'><fieldset id='8qbEi'></fieldset></dl></div>
      2. HTML5 中的自闭合标签(空元素)

        时间:2023-07-31

        <small id='A7lji'></small><noframes id='A7lji'>

          <tfoot id='A7lji'></tfoot>

              • <bdo id='A7lji'></bdo><ul id='A7lji'></ul>
                  <tbody id='A7lji'></tbody>
                <i id='A7lji'><tr id='A7lji'><dt id='A7lji'><q id='A7lji'><span id='A7lji'><b id='A7lji'><form id='A7lji'><ins id='A7lji'></ins><ul id='A7lji'></ul><sub id='A7lji'></sub></form><legend id='A7lji'></legend><bdo id='A7lji'><pre id='A7lji'><center id='A7lji'></center></pre></bdo></b><th id='A7lji'></th></span></q></dt></tr></i><div id='A7lji'><tfoot id='A7lji'></tfoot><dl id='A7lji'><fieldset id='A7lji'></fieldset></dl></div>
                <legend id='A7lji'><style id='A7lji'><dir id='A7lji'><q id='A7lji'></q></dir></style></legend>

                  本文介绍了HTML5 中的自闭合标签(空元素)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  HTML5 规范 8.1.2.1 开始标签的第 6 步说 void 元素 可能只有一个 / 字符.我认为这样可以更轻松地将 XHTML 网站迁移到 HTML5.

                  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 that are XHTML over to HTML5.

                  最佳做法是什么?

                  例如,如果我正在使用 HTML5 (<!DOCTYPE html>) 制作网站,我应该怎么做?

                  E.g., if I'm making a website with HTML5 (<!DOCTYPE html>), which should I do?

                  1. 没有斜线

                  1. without the slash

                  <meta http-equiv="content-type" content="text/html; charset=utf-8">
                  

                1. 用斜线

                2. with the slash

                  <meta http-equiv="content-type" content="text/html; charset=utf-8" />
                  

                3. 如果两者都在所有浏览器上正确呈现,那么我假设 (1) 没有斜线是可行的方法,因为它更多的是 HTML5.

                  If both render correctly on all browsers, then I'm assuming (1) without the slash is the way to go since it's more HTML5.

                  推荐答案

                  最佳实践没有共识,根据规范作者 Ian Hickson 的说法,这并不重要.

                  There is no consensus on best practice, and according to the author of the spec, Ian Hickson, it does not matter.

                  这篇关于HTML5 中的自闭合标签(空元素)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:XML/HTML 标记内的空白 下一篇:在 HTML5 中,&lt;header&gt;和&lt;页脚&gt;标签出现在 &am

                  相关文章

                4. <tfoot id='2H86N'></tfoot>
                5. <legend id='2H86N'><style id='2H86N'><dir id='2H86N'><q id='2H86N'></q></dir></style></legend>
                6. <small id='2H86N'></small><noframes id='2H86N'>

                      <bdo id='2H86N'></bdo><ul id='2H86N'></ul>

                    1. <i id='2H86N'><tr id='2H86N'><dt id='2H86N'><q id='2H86N'><span id='2H86N'><b id='2H86N'><form id='2H86N'><ins id='2H86N'></ins><ul id='2H86N'></ul><sub id='2H86N'></sub></form><legend id='2H86N'></legend><bdo id='2H86N'><pre id='2H86N'><center id='2H86N'></center></pre></bdo></b><th id='2H86N'></th></span></q></dt></tr></i><div id='2H86N'><tfoot id='2H86N'></tfoot><dl id='2H86N'><fieldset id='2H86N'></fieldset></dl></div>