html – 什么是DOCTYPE的要点?

html – 什么是DOCTYPE的要点?,第1张

概述我知道不同的doctypes本质上是关于html是如何兼容的,但是它有什么区别呢?浏览器根据doctype的不同处理相同的代码? 谢谢 UPDATE – 如果没有指定doctype,大多数答案提到怪异模式可以关闭.但是xhtml和html 4.01之间会有什么区别? 最大的事情是做一个doctype.如果没有,浏览器将以“怪癖”模式而不是标准模式工作,许多事情将略有不同.如果您有一个 – 通常在浏 我知道不同的DOCTYPEs本质上是关于HTML是如何兼容的,但是它有什么区别呢?浏览器根据DOCTYPE的不同处理相同的代码?
谢谢

UPDATE – 如果没有指定DOCTYPE,大多数答案提到怪异模式可以关闭.但是xhtml和HTML 4.01之间会有什么区别?

解决方法 最大的事情是做一个DOCTYPE.如果没有,浏览器将以“怪癖”模式而不是标准模式工作,许多事情将略有不同.如果您有一个 – 通常在浏览器中激活更符合标准的行为.

有关各种不同浏览器的DOCTYPEs功能的详细信息,请参阅@L_419_0@,以及不同浏览器有什么样的模式 – 怪癖,标准,几乎标准等.引用相关部分:

Modes for text/HTML Content

The choice
of the mode for text/HTML content
depends on DOCTYPE sniffing (discussed
later in this document). In ie8 and
IE9,the mode also depends on other
factors. However,by default even in
ie8 and IE9,the mode depends on the
DOCTYPE for non-intranet sites that
are not on a blackList supplIEd by
Microsoft.

It cannot be stressed
enough that the exact behavior of the
modes varIEs from browser to browser
even though discussion in this
document has been unifIEd.

Quirks Mode

In the Quirks mode the
browsers violate contemporary Web
format specifications in order to
avoID “breaking” pages authored
according to practices that were
prevalent in the late 1990s. Different
browsers implement different quirks.
In Internet Explorer 6,7,8 and 9,
the Quirks mode is effectively froZen
IE 5.5. In other browsers,the Quirks
mode is a handful of deviations from
the Almost Standards mode.

If you are authoring new pages Now,
you are supposed to comply with the
relevant specifications (CSS 2.1 in
particular) and use the Standards
mode.

Standards Mode

In the Standards mode
the browsers try to give conforming
documents the specification-wise
correct treatment to the extent
implemented in a particular browser.

Since different browsers are at
different stages of compliance,the
Standards mode isn’t a single target,
either.

HTML 5 calls this mode the “no quirks
mode”.

Almost Standards Mode

firefox,Safari,
Chrome,Opera (since 7.5),ie8 and IE9
also have a mode kNown as “the Almost
Standards mode”,which implements the
vertical sizing of table cells
Traditionally and not rigorously
according to the CSS2 specification.
Mac IE 5,windows IE 6 and 7,Opera
prior to 7.5 and Konqueror do not need
an Almost Standards mode,because they
don’t implement the vertical sizing of
table cells rigorously according to
the CSS2 specification in their
respective Standards modes anyway. In
fact,their Standards modes are closer
to the Almost Standards mode than to
the Standards mode of newer browsers.

HTML 5 calls this mode the “limited
quirks mode”.

ie7 Mode

ie8 and IE9 have a mode that
is mostly a froZen copy of the mode
that was the Standards mode in ie7.
Other browsers do not have a mode like
this,and this mode is not specifIEd
by HTML5.

ie8 Standards Mode

IE9 has a mode that
is mostly a froZen copy of the mode
that was the Standards mode in ie8.
Other browsers do not have a mode like
this,and this mode is not specifIEd
by HTML5.

ie8 Almost Standards Mode

IE9 has a
mode that is mostly a froZen copy of
the mode that was the Almost Standards
mode in ie8. Other browsers do not
have a mode like this,and this mode
is not specifIEd by HTML5.

…但是请看文章进行全面的讨论.

总结

以上是内存溢出为你收集整理的html – 什么是DOCTYPE的要点?全部内容,希望文章能够帮你解决html – 什么是DOCTYPE的要点?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/web/1145127.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-31
下一篇 2022-05-31

发表评论

登录后才能评论

评论列表(0条)

保存