English 中文(简体)
是否有不同的HTML5 doctype?
原标题:Are there different HTML5 doctypes?
  • 时间:2012-05-25 09:40:54
  •  标签:
  • html
  • doctype

当我用 XHTML 写入页面时。 我有3种类型 doctype - strict , transitional frameset

HTML5里有吗?

最佳回答

不,HTML5只是HTML5,没有子集。

问题回答

html5 doc 类型

<!DOCTYPE html>

当您使用新的 < 坚固> HTML5 DOCTYPE 时,它会触发浏览器,使页面达到 < 坚固 > 标准达标模式

<坚固>标准达标模式

  • In standards-compliant mode, the web browser assumes the page has been authored to the web content specification declared; code that does not conform to the declared standard may not display, or may display incorrectly.
  • For a web browser’s standards-compliant mode to be triggered, the webpage must have a complete document type declaration, including the URI to the document type definition (DTD).
  • There is typically less variation in webpage display between different browsers when standards-compliant mode is triggered, as the same centralised W3C specification is used as a reference when creating the web browser software.

向这个 < a href=>""http://www.motive.co.nz/glossary/quirks-mode.php" rel="noreferr" >link

否, HTML5 doctype

<!DOCTYPE html>

具有独特性,因为它被选为能够翻转所有当前浏览器(甚至 IE6, afaik) 的最短的 doctype (string) 在标准模式 (可以用上/混合大小写)

HTML 5 需要一种用于遗留兼容性的 doc 类型。 它有一个短的 doc类型 < code\ lt;! DOCTYPE html> 和一个长的 docty 类型 ! DOCTYPE htmlhtml 系统“ 有关: legicity- compat” & gt; 长的 doc 类型仅用于无法生成短的系统 。 - < a href=" http://www.w3. org/ TR/2011/ WD- html5- 20110525/syntax.html#the-doctype” > HTML 5 规范

只有一个:

<!DOCTYPE html>

标准 < a href="" "http://dev.w3.org/html5/spec/syntax.html#the-doctype" rel=“nofolpt”>在HTML HTML 序列化 HTML 5 (即作为text/html ) 中要求的序言 。

<!DOCTYPE html>

一些 HTML 生成器, 特别是 XSLT, 难以创建上述 doc 类型 。 它们可能使用

<!DOCTYPE html SYSTEM "about:legacy-compat">

在HTML5的 XML 序列化中(即当被作为 application/xhtml+xml 使用时), doctype 可以是上述两种类型之一,也可以完全省略。

请注意,这些变异并非严格、过渡或框架设置。 HTML 5 中有效或无效的内容对上述每种变异都是相同的---- 暂且不考虑 HTML 和 XML 语法之间的差异。

HTML5只有一个,即:

<!DOCTYPE html>




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签