gpt4 book ai didi

html - 为什么 Firefox 以红色突出显示 HTML 过渡文档类型?

转载 作者:太空狗 更新时间:2023-10-29 13:44:48 26 4
gpt4 key购买 nike

看起来 Firefox 正在将其视为错误。这是什么意思?

enter image description here

如果我将其更改为:Firefox 会正常对待它:

<!DOCTYPE html>
<html>

顺便说一句,我使用的是 Firefox 12.0

最佳答案

如果您将鼠标悬停在那条红线上,Firefox 会给您答案。

Almost standards mode doctype. Expected “<!DOCTYPE html>”

View Source 的标记也暗示了它的错误文档类型

<span class="error doctype" title="Almost standards mode doctype. Expected “<!DOCTYPE html>”.">
&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
</span>

重点是,Firefox 想要<!DOCTYPE html>作为 standard mode doc-type .

更新:

摘自上面给出的链接。

The DOCTYPE shown in the example, <!DOCTYPE html>, is the simplest possible, and the one recommended by HTML5. Earlier versions of the HTML standard recommended other variants, but all existing browsers today will use full standards mode for this DOCTYPE, even the dated Internet Explorer 6. There are no valid reasons to use a more complicated DOCTYPE. If you do use another DOCTYPE, you may risk choosing one, which triggers almost standards mode or quirks mode.

关于html - 为什么 Firefox 以红色突出显示 HTML 过渡文档类型?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10775005/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com