HTML:包含或排除可选的结束标签?

发布于 2024-09-05 04:11:44 字数 1647 浏览 6 评论 0 原文

一些 HTML1 结束标记是可选,即:

</HTML>
</HEAD>
</BODY>
</P>
</DT>
</DD>
</LI>
</OPTION>
</THEAD>
</TH>
</TBODY>
</TR>
</TD>
</TFOOT>
</COLGROUP>

注意:不要与禁止包含的结束标签相混淆,即:

</IMG>
</INPUT>
</BR>
</HR>
</FRAME>
</AREA>
</BASE>
</BASEFONT>
</COL>
</ISINDEX>
</LINK>
</META>
</PARAM>

注意: xhtml 与 HTML 不同。 xhtml 是 xml 的一种形式,它要求每个元素都有一个结束标记。结束标签在 html 中可以是禁止,但在 xhtml 中是强制

可选的结束标记

  • 是否理想地包含,但如果您忘记了它们,我们会接受它们,或者
  • 理想地不包含,但如果您将它们放入

In, 我们会接受它们换句话说,我应该包含它们,还是不应该包含它们?

HTML 4.01 规范讨论了关闭元素标签是可选的,但没有说明是否最好包含它们,或者最好不包含它们。

另一方面,一篇关于 DevGuru 的随机文章说

结束标签是可选的。不过,建议将其包括在内。

我问的原因是因为您知道出于兼容性原因它是可选的;如果可以的话,他们会制定这些规定(强制 | 禁止)。

换句话说:HTML 1、2、3 对这些现在可选的结束标记做了什么。 HTML 5 有什么作用?我应该做什么?

注意

HTML 中的某些元素禁止拥有结束标记。您可能不同意这一点,但这就是规范,没有争议。我问的是可选结束标签,以及其意图是什么。

脚注

1HTML 4.01

Some HTML1 closing tags are optional, i.e.:

</HTML>
</HEAD>
</BODY>
</P>
</DT>
</DD>
</LI>
</OPTION>
</THEAD>
</TH>
</TBODY>
</TR>
</TD>
</TFOOT>
</COLGROUP>

Note: Not to be confused with closing tags that are forbidden to be included, i.e.:

</IMG>
</INPUT>
</BR>
</HR>
</FRAME>
</AREA>
</BASE>
</BASEFONT>
</COL>
</ISINDEX>
</LINK>
</META>
</PARAM>

Note: xhtml is different from HTML. xhtml is a form of xml, which requires every element have a closing tag. A closing tag can be forbidden in html, yet mandatory in xhtml.

Are the optional closing tags

  • ideally included, but we'll accept them if you forgot them, or
  • ideally not included, but we'll accept them if you put them in

In other words, should I include them, or should I not include them?

The HTML 4.01 spec talks about closing element tags being optional, but doesn't say if it's preferable to include them, or preferable to not include them.

On the other hand, a random article on DevGuru says:

The ending tag is optional. However, it is recommended that it be included.

The reason I ask is because you just know it's optional for compatibility reasons; and they would have made them (mandatory | forbidden) if they could have.

Put it another way: What did HTML 1, 2, 3 do with regards to these, now optional, closing tags. What does HTML 5 do? And what should I do?

Note

Some elements in HTML are forbidden from having closing tags. You may disagree with that, but that is the specification, and it's not up for debate. I'm asking about optional closing tags, and what the intention was.

Footnotes

1HTML 4.01

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(14

内心激荡 2024-09-12 04:11:44

在某些情况下,明确的标签会有所帮助,但有时这是不必要的迂腐。

请注意,HTML 规范明确指定了何时可以省略标签,因此并不总是错误。

例如,您永远不需要 。没有人记得明确地放置 (以至于 XHTML 对此做出了例外)。

您不需要 除非您有实际搜索 的 DOM 操作脚本(那么最好显式关闭它,因为 隐含结束的规则可能会让您感到惊讶)。

嵌套列表实际上没有 会更好,因为这样就更难创建错误的 ul > 了。 ul 树。

有效:

<ul>
  <li>item
  <ul>
    <li>item
  </ul>
</ul>

无效:

<ul>
  <li>item</li>
  <ul>
    <li>item</li>
  </ul>
</ul>

请记住,无论您是否尝试关闭所有元素,都隐含结束标记。添加结束标签不会自动使解析更加健壮:

<p>foo <p>bar</p> baz</p>

将解析为:

<p>foo</p><p>bar</p> baz

它仅在验证文档时才有帮助。

There are cases where explicit tags help, but sometimes it's needless pedantry.

Note that the HTML spec clearly specifies when it's valid to omit tags, so it's not always an error.

For example you never need </body></html>. Nobody ever remembers to put <tbody> explicitly (to the point that XHTML made exceptions for it).

You don't need </head><body> unless you have DOM-manipulating scripts that actually search <head> (then it's better to close it explicitly, because rules for implied end of <head> could surprise you).

Nested lists are actually better off without </li>, because then it's harder to create erroneous ul > ul tree.

Valid:

<ul>
  <li>item
  <ul>
    <li>item
  </ul>
</ul>

Invalid:

<ul>
  <li>item</li>
  <ul>
    <li>item</li>
  </ul>
</ul>

And keep in mind that end tags are implied whether you try to close all elements or not. Putting end tags won't automatically make parsing more robust:

<p>foo <p>bar</p> baz</p>

will parse as:

<p>foo</p><p>bar</p> baz

It can only help when you validate documents.

一笔一画续写前缘 2024-09-12 04:11:44

可选的都是那些在语义上应该清楚其结束位置的内容,而不需要结束标记。
EG 每个

  • 隐含一个
  • (如果其前面没有)。

    禁止的结束标记都将立即跟随其结束标记,因此必须输入 blah 每次。

    我几乎总是使用可选标签(除非我有充分的理由不这样做),因为它可以提供更具可读性和可更新性的代码。

    The optional ones are all ones that should be semantically clear where they end, without needing the end tag.
    E.G. each <li> implies a </li> if there isn't one right before it.

    The forbidden end tags all would be immediately followed by their end tag so it would be kind of redundant to have to type <img src="blah" alt="blah"></img> every time.

    I almost always use the optional tags (unless I have a very good reason not to) because it lends to more readable and updateable code.

    青丝拂面 2024-09-12 04:11:44

    我在这里添加一些链接来帮助您了解 HTML 的历史,以便您了解各种矛盾。这不是您问题的答案,但阅读这些不同的摘要后您会了解更多。

    深入了解 HTML5< 的一些摘录/a>:

    [T]“损坏的”HTML 标记在网络浏览器中仍然有效,这一事实导致作者创建了损坏的 HTML 页面。很多破损的页面。据估计,当今网络上超过 99% 的 HTML 页面都至少存在一个错误。但由于这些错误不会导致浏览器显示可见的错误消息,因此没有人修复它们。

    W3C 认为这是网络的一个根本问题,并着手解决它。 1997 年发布的 XML 打破了宽容客户的传统,并规定所有使用 XML 的程序必须将所谓的“格式正确”错误视为致命错误。这种在第一个错误上失败的概念被称为“严厉的错误处理”,以希腊领导人 Draco 命名 他对相对轻微的违反法律的行为判处死刑。当 W3C 将 HTML 重新表述为 XML 词汇表时,他们要求所有使用新 application/xhtml+xml MIME 类型的文档都必须接受严格的错误处理。如果您的 XHTML 页面中甚至存在一个格式良好的错误,[...] Web 浏览器将别无选择,只能停止处理并向最终用户显示错误消息。

    这个想法并没有普遍流行。现有页面的估计错误率为 99%,向最终用户显示错误的可能性始终存在,并且 XHTML 1.0 和 1.1 中缺乏新功能来证明成本的合理性,网络作者基本上忽略了 application/ xhtml+xml。但这并不意味着他们完全忽略了 XHTML。哦,绝对不是。 XHTML 1.0 规范的附录 C 给了世界各地的网络作者一个漏洞:“使用看起来有点像 XHTML 语法的东西,但继续使用 text/html MIME 类型来提供它。”这正是成千上万的 Web 开发人员所做的:他们“升级”到 XHTML 语法,但继续使用 text/html MIME 类型提供服务。

    即使在今天,仍有数百万网页声称是 XHTML。它们从第一行的 XHTML 文档类型开始,使用小写标签名称,在属性值周围使用引号,并在空元素后添加尾部斜杠,例如
    <;小时>>。但这些页面中只有一小部分使用了 application/xhtml+xml MIME 类型,该类型会触发 XML 的严格错误处理。任何使用 text/html MIME 类型的页面(无论文档类型、语法或编码风格如何)都将使用“宽容”的 HTML 解析器进行解析,默默地忽略任何标记错误,并且永远不会警告结束用户(或任何其他人),即使页面在技术上已损坏。

    XHTML 1.0 包含此漏洞,但 XHTML 1.1 关闭了它,而从未最终确定的 XHTML 2.0 延续了要求严格错误处理的传统。这就是为什么有数十亿个页面声称是 XHTML 1.0,而只有少数页面声称是 XHTML 1.1(或 XHTML 2.0)。那么您真的在使用 XHTML 吗?检查您的 MIME 类型。 (实际上,如果您不知道正在使用什么 MIME 类型,我几乎可以保证您仍在使用 text/html。)除非您使用 MIME 提供页面application/xhtml+xml 类型,所谓的“XHTML”只是名义上的 XML。

    提出进化 HTML 和 HTML 表单的人们面临着两个选择:放弃,或者在 W3C 之外继续他们的工作。他们选择了后者,注册了 whatwg.org 域名,并于 2004 年 6 月, WHAT 工作组诞生

    “WHAT”工作组也在悄悄地处理其他一些事情。其中之一是最初被称为 Web Forms 2.0 的规范,该规范向 HTML 表单添加了新类型的控件。 (您将在疯狂的形式中了解有关 Web 表单的更多信息。)另一个是名为“的草案规范” Web 应用程序 1.0”,其中包括主要的新功能,例如直接模式绘图画布以及对无需插件的音频和视频。

    2009 年 10 月,W3C 关闭了 XHTML 2 工作组发表此声明来解释他们的决定

    <块引用>

    当 W3C 于 2007 年 3 月宣布成立 HTML 和 XHTML 2 工作组时,我们表示我们将继续监控 XHTML 2 的市场。W3C 认识到向社区发出有关 HTML 未来的明确信号的重要性。

    虽然我们认识到 XHTML 2 工作组多年来所做贡献的价值,但在与参与者讨论后,W3C 管理层决定允许该工作组的章程于 2009 年底到期,并且不再续签。

    获胜者就是发货者。

    I am adding some links here to help you with the history of HTML, for you to understand the various contradictions. This is not the answer to your question, but you will know more after reading these various digests.

    Some excerpts from Dive Into HTML5:

    [T]he fact that “broken” HTML markup still worked in web browsers led authors to create broken HTML pages. A lot of broken pages. By some estimates, over 99% of HTML pages on the web today have at least one error in them. But because these errors don’t cause browsers to display visible error messages, nobody ever fixes them.

    The W3C saw this as a fundamental problem with the web, and they set out to correct it. XML, published in 1997, broke from the tradition of forgiving clients and mandated that all programs that consumed XML must treat so-called “well-formedness” errors as fatal. This concept of failing on the first error became known as “draconian error handling,” after the Greek leader Draco who instituted the death penalty for relatively minor infractions of his laws. When the W3C reformulated HTML as an XML vocabulary, they mandated that all documents served with the new application/xhtml+xml MIME type would be subject to draconian error handling. If there was even a single well-formedness error in your XHTML page […] web browsers would have no choice but to stop processing and display an error message to the end user.

    This idea was not universally popular. With an estimated error rate of 99% on existing pages, the ever-present possibility of displaying errors to the end user, and the dearth of new features in XHTML 1.0 and 1.1 to justify the cost, web authors basically ignored application/xhtml+xml. But that doesn’t mean they ignored XHTML altogether. Oh, most definitely not. Appendix C of the XHTML 1.0 specification gave the web authors of the world a loophole: “Use something that looks kind of like XHTML syntax, but keep serving it with the text/html MIME type.” And that’s exactly what thousands of web developers did: they “upgraded” to XHTML syntax but kept serving it with a text/html MIME type.

    Even today, millions of web pages claim to be XHTML. They start with the XHTML doctype on the first line, use lowercase tag names, use quotes around attribute values, and add a trailing slash after empty elements like <br /> and <hr />. But only a tiny fraction of these pages are served with the application/xhtml+xml MIME type that would trigger XML’s draconian error handling. Any page served with a MIME type of text/html — regardless of doctype, syntax, or coding style — will be parsed using a “forgiving” HTML parser, silently ignoring any markup errors, and never alerting end users (or anyone else) even if the pages are technically broken.

    XHTML 1.0 included this loophole, but XHTML 1.1 closed it, and the never-finalized XHTML 2.0 continued the tradition of requiring draconian error handling. And that’s why there are billions of pages that claim to be XHTML 1.0, and only a handful that claim to be XHTML 1.1 (or XHTML 2.0). So are you really using XHTML? Check your MIME type. (Actually, if you don’t know what MIME type you’re using, I can pretty much guarantee that you’re still using text/html.) Unless you’re serving your pages with a MIME type of application/xhtml+xml, your so-called “XHTML” is XML in name only.

    [T]he people who had proposed evolving HTML and HTML forms were faced with two choices: give up, or continue their work outside of the W3C. They chose the latter, registered the whatwg.org domain, and in June 2004, the WHAT Working Group was born.

    [T]he WHAT working group was quietly working on a few other things, too. One of them was a specification, initially dubbed Web Forms 2.0, which added new types of controls to HTML forms. (You’ll learn more about web forms in A Form of Madness.) Another was a draft specification called “Web Applications 1.0,” which included major new features like a direct-mode drawing canvas and native support for audio and video without plugins.

    In October 2009, the W3C shut down the XHTML 2 Working Group and issued this statement to explain their decision:

    When W3C announced the HTML and XHTML 2 Working Groups in March 2007, we indicated that we would continue to monitor the market for XHTML 2. W3C recognizes the importance of a clear signal to the community about the future of HTML.

    While we recognize the value of the XHTML 2 Working Group’s contributions over the years, after discussion with the participants, W3C management has decided to allow the Working Group’s charter to expire at the end of 2009 and not to renew it.

    The ones that win are the ones that ship.

    暗地喜欢 2024-09-12 04:11:44

    我问的原因是因为您知道出于兼容性原因它是可选的;如果可以的话,他们会制定这些规则(强制 | 禁止)。

    这是一个有趣的推论。我的解读是,几乎任何时候可以可靠地推断出标签,该标签都是可选的。该设计表明其目的是使其快速且易于编写。

    HTML 1、2、3 对这些现在可选的结束标记做了什么。

    HTML 2 的 DTD 嵌入在 RFC 中,它与原始的 < a href="http://www.w3.org/MarkUp/html-spec/html.dtd" rel="noreferrer">HTML DTD,到处都有可选的开始和结束标记。

    HTML 3 被放弃(由于浏览器战争)并被 HTML 3.2 取代(它旨在描述当时的 Web 状态)。

    HTML 5 有什么作用?

    HTML 5 从一开始就致力于“铺平牛道”。

    我该怎么办?

    啊,现在这是主观的和有争议的:)

    有些人认为显式标签由于位于读者眼前而更具可读性和可维护性。

    有些人认为推断标签不会使编辑器变得混乱,因此具有更好的可读性和可维护性。

    The reason i ask is because you just know it's optional for compatibility reasons; and they would have made them (mandatory | forbidden) if they could have.

    That's an interesting inference. My reading of it is that just about any time a tag could be reliably inferred, the tag is optional. The design suggests that the intention was to make it quick and easy to write.

    What did HTML 1, 2, 3 do with regards to these, now optional, closing tags.

    The DTD for HTML 2 is embedded in the RFC which, along with the original HTML DTD, has optional start and end tags all over the place.

    HTML 3 was abandoned (thanks to the browser wars) and replaced with HTML 3.2 (which was designed to describe the then current state of the web).

    What does HTML 5 do?

    HTML 5 was geared towards "paving the cowpaths" from the outset.

    And what should i do?

    Ah, now that is subjective and argumentative :)

    Some people think that explicit tags are better for readability and maintainability by virtue of being in front of the readers eyes.

    Some people think that inferred tags are better for readability and maintainability by virtue of not cluttering up the editor.

    年华零落成诗 2024-09-12 04:11:44

    HTML 5 有什么作用?

    这个问题的答案在 W3C 工作草案中:
    http://www.w3.org/TR/html5/syntax .html#syntax-tag-omission

    我该怎么办?

    这是风格问题。我尽量不省略结束标签,因为它可以帮助我保持严谨,省略必要的标签。

    What does HTML 5 do?

    The answer to this question is in the W3C Working Draft:
    http://www.w3.org/TR/html5/syntax.html#syntax-tag-omission

    And what should i do?

    It's a matter of style. I try to never omit end tags because it helps me to be rigorous and not omit tags that are necessary.

    沒落の蓅哖 2024-09-12 04:11:44

    如果它是多余的,请将其删除。

    如果它有某种目的(即使是看似微不足道的目的,例如安抚您的 IDE 或安抚您的眼睛),请将其保留。

    在明确定义的规范中很少会看到不影响行为的可选项目。当然,“评论”除外。但 HTML 规范与其说是设计规范,不如说是当前主要实现状态的文档。因此,当 HTML 中的某个项目是可选的并且它似乎没有任何用途时,我们可能会猜测可选性质仅仅是特定浏览器中的怪癖的文档。

    查看上面链接的 HTML-5 规范 RFC 部分,您会发现可选标签奇怪地与注释的存在相关联!这应该告诉你作者并没有戴设计帽子。相反,他们在主要实现中玩“记录怪癖”的游戏。所以我们在这方面不能太认真地对待规范。

    所以,解决办法就是:别出汗。继续做真正重要的事情。 :)

    If it is superfluous, leave it out.

    If it serves a purpose (even a seemingly trivial purpose, such as appeasing your IDE or appeasing your eyes), leave it in.

    It's rare in a well-defined spec to see optional items that do not affect behavior. With the exception of "comments", of course. But the HTML spec is less of a design spec, and more of a document of the state of current major implementations. So when an item is optional in HTML and it seems to serve no purpose, we may guess that optional nature is merely documentation of a quirk in specific browser.

    Looking at the HTML-5 spec RFC section linked above, you see that the optional tags are strangely linked to the presence of comments! That should tell you that the authors are not wearing design hats. They are instead playing the game of "document the quirks" in major implementations. So we can't take the spec too seriously in this respect.

    So, the solution is: Don't sweat it. Move on to something that actually matters. :)

    奈何桥上唱咆哮 2024-09-12 04:11:44

    我认为最好的答案是包含结束标签以提高可读性或错误检测。但是,如果您有大量生成的 HTML(例如数据表),则可以通过省略可选标签来节省大量带宽。

    I think the best answer is to include closing tags for readability or error detection. However, if you have lots of generated HTML (say, tables of data), you could save significant bandwidth by omitting optional tags.

    春风十里 2024-09-12 04:11:44

    我的建议是省略大多数可选的关闭标签以及所有可以忽略的可选属性。许多 IDE 会抱怨,因此您可能无法忽略其中一些,但通常对于较小的文件大小和较少的混乱来说更好。如果您有代码生成器,那么肯定会省略结束标记,因为您可以从中获得一些良好的尺寸减小。通常,无论哪种方式都并不重要。

    但当事情确实重要时,就采取行动。在我最近的一些工作中,通过消除开放标记的大部分生成的结束属性和冗余值属性,我能够将渲染的 HTML 大小从 1.5 MB 减少到 800 KB,其中元素的文本与价值。我有大约 200 个标签。我可以完全以其他方式实现这一点,但这会需要更多工作($$$),因此这使我可以轻松地使页面更具响应性。

    出于好奇,我发现如果删除不需要的属性周围的引号,我可以节省 20 KB,但我的 IDE (Visual Studio) 不喜欢它。我还惊讶地发现 ASP.NET 生成的非常长的 ID 占我文件的 20%。

    我们可以获得严格有效的 HTML 任何相关部分的想法从一开始就被误导了,所以请采取最适合您和您的客户的方式。我见过或使用过的大多数工具都会说它们生成 xhtml,但它们并不是真正 100% 工作,而且严格遵守也没有任何好处。

    My recommendation is that you omit most optional close tags, and all optional attributes that you can get away with. Many IDEs will complain so you may not be able to get away with omitting some of these but it is generally better for smaller file size and less clutter. If you have code generators definitely omit end tags there because you can get some good size reduction from it. Usually it doesn't really matter one way or the other.

    But when it does matter then act on it. On some recent work of mine I was able to reduce the size of my rendered HTML from 1.5 MB to 800 KB by eliminating most of the generated end and redundant value attributes for the open tag, where the text of the element was the same as the value. I have about 200 tags. I could implement this some other way entirely, but that would be more work ($$$), so this allows me to easily make the page more responsive.

    Just out of curiosity I found that if I removed quotes around attributes that didn't need them I could save 20 KB, but my IDE (Visual Studio) doesn't like it. I also was surprised to find that the really long ID that ASP.NET generates account for 20% of my file.

    The idea that we could ever get any relevant fraction of HTML strictly valid was misguided in the first place, so do whatever works best for you and your customers. Most tools that I have ever seen or used will say they generate xhtml, but they don't really work 100%, and there isn't any benefit to strict adherence anyway.

    伴我心暖 2024-09-12 04:11:44

    就我个人而言,我是 XHTML 的粉丝,并且像 ghoppe 一样,“我尽量不省略结束标记,因为它可以帮助我保持严谨,而不是省略必要的标记。”

    但是,

    如果您有意使用 HTML 4.n,则不能说包含它们可以更轻松地使用文档,因为与有效性相对的格式良好的概念是一个 XML 概念,并且当您您禁止某些关闭标签。所以唯一的问题是有效性......如果没有它们仍然有效......你最好节省带宽,不是吗?

    Personally, I'm a fan of XHTML and, like ghoppe, "I try to never omit end tags because it helps me to be rigorous and not omit tags that are necessary."

    but

    If you're deliberately using HTML 4.n, one can't argue that including them makes it easier to consume the document, as the notion of well-formedness as opposed to validity is an XML concept, and you lose that benefit when you forbid certain close tags. So the only issue becomes validity... and if it's still valid without them... you might as well save the bandwidth, no?

    追星践月 2024-09-12 04:11:44

    使用结束标签可以更轻松地处理片段,因为它们的行为不依赖于同级元素。仅这个理由就应该足够令人信服了。有人再处理单一的 html 文档吗?

    Using end tags makes dealing with fragments easier because their behaviour is not dependant on sibling elements. This reason alone should be compelling enough. Does anyone deal with monolithic html documents anymore?

    默嘫て 2024-09-12 04:11:44

    在某些大括号语言(例如 C#)中,如果 if 语句只有两行长,则可以省略 if 语句周围的大括号。例如...

    if ([条件])
        [代码]

    但你不能这样做...

    if ([条件])
        [代码]
        [code]

    第三行不会成为 if 语句的一部分。它会损害可读性,并且很容易引入错误,并且很难发现。

    出于同样的原因,我关闭了所有标签。像 img 标签这样的标签仍然需要关闭,只是不需要单独的关闭标签。

    In some curly bracket languages like C#, you can omit the curly braces around an if statement if its only two lines long. for example...

    if ([condition])
        [code]

    but you can't do this...

    if ([condition])
        [code]
        [code]

    the third line won't be a part of the if statement. it hurts readability, and bugs can be easily introduced, and be difficult to find.

    for the same reasons, i close all tags. tags like the img tag do still need to be closed, just not with a separate closing tag.

    暗喜 2024-09-12 04:11:44

    做任何你认为能让代码更具可读性和可维护性的事情。

    就我个人而言,我总是倾向于关闭 ,但我永远不会打扰

  • Do whatever you feel makes the code more readable and maintainable.

    Personally I would always be inclined to close <td> and <tr>, but I would never bother with <li>.

    垂暮老矣 2024-09-12 04:11:44

    如果您正在编写 HTML 解析器,那么解析包含可选结束标记的 HTML 或不包含可选结束标记的 HTML 会更容易吗?我认为存在的可选结束标签会让事情变得更容易,因为我不必推断结束标签应该在哪里。

    出于这个原因,我总是包含可选的结束标签 - 理论上我的页面可能会渲染得更快,因为我为浏览器的 HTML 解析器创建了更少的工作。

    If you were writing an HTML parser, would it be easier to parse HTML that included optional closing tags, or HTML that doesn't? I think the optional closing tags being present would make it easier, as I wouldn't have to infer where the closing tag should be.

    For that reason, I always include the optional closing tags - on the theory that my page might render faster, as I'm creating less work for the browser's HTML parser.

    無心 2024-09-12 04:11:44

    对于禁止的关闭类型,请使用如下语法: 使用 /> 来关闭 xml 中接受的标签

    For forbidden closing types use syntax like: <img /> With the /> to close the tag which is accepted in xml

    ~没有更多了~
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文