html - 严格和过渡文档类型之间的真正区别是什么

标签 html xhtml doctype strict transitional

<分区>

我读过许多解释严格文档类型和过渡文档类型之间区别的论坛,但没有一个解释在呈现页面时选择严格文档类型还是过渡文档类型。例如:在严格的文档类型中不推荐使用“i”标签。但无论您使用哪种文档类型,它都可以在您的网页中正常呈现。其他已弃用的标签(例如“u”或“font”)也是如此。所以我的问题是,在页面呈现方面,严格文档类型和过渡文档类型之间是否存在真正的区别。

最佳答案

What differs in almost-standards mode is roughly this: inline boxes that have no non-whitespace text as a child and have no border, padding, or margin:

  • 不影响行框的大小(即忽略它们的行高)
  • 不要让高度(例如,对于他们的背景)大于他们后代的高度,即使他们的字体更大(如果他们没有后代,他们的基线高度为零)

The HTML 4.01 transitional doctype validates against the HTML 4.01 spec. It allows some presentational markup and deprecated elements (such as elements) but not framesets.

The HTML 4.01 strict doctype validates against the HTML 4.01 spec, although it doesn't allow any presentational markup or deprecated elements (such as elements) or framesets to be used.

If you are using an XHTML doctype, you need to use XML well-formed syntax

引用资料

关于html - 严格和过渡文档类型之间的真正区别是什么,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15137819/

相关文章:

html - 加载 CSS 异步的最佳方式是什么?

html - W3C 不再维护多语言标记?

html - iframe 100% 高度导致垂直滚动条

javascript - 无法使用本地存储中的 JavaScript 填充电子邮件字段

html - 如何在 GitHub README.md 中使用边距/填充?

javascript - document.registerElement - 为什么我们需要同时指定 'prototype' 和 'extends' ?

html - 放大时如何阻止边框分开?

css - IE中的下拉菜单问题

HTML-Doctype 杀死 css 声明 "height: 100%;"

html - header 中 xhtml 文档类型的语法错误