"<!DOCTYPE html>"这是什么意思? [英] "<!DOCTYPE html>" What does it mean?

查看:204
本文介绍了"<!DOCTYPE html>"这是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用了一个名为ECOTree的奇妙javascript组织树生成器,但是当我将<!DOCTYPE html> 时绘图不起作用。

您可以在下面的网站上的sample1.htm处看到错误。任何人都可以建议我如何解决。
http://www.codeproject.com/script/Articles/ViewDownloads.aspx? (为了遵循我的项目规则,我必须定义<!DOCTYPE html> $ b < c code

<!DOCTYPE html> 明确的文件类型声明



从链接页面:


DOCTYPE声明(DTD或文档类型声明)执行以下几项操作:


  1. 在网页上执行HTML验证测试时,它会告知HTML(超文本标记语言)验证程序,该网页编码应假定(X)HTML标准的哪个版本遵从。当您验证您的网页时,HTML验证程序会根据适用的标准检查编码,然后报告哪些编码部分未通过HTML验证(不符合)。 它告诉浏览器以符合标准的模式呈现网页。


#2是使用它的一个非常重要的原因。



<!DOCTYPE html> ,具体来说就是 HTML5的正确声明,并且应该在不久的将来使用。您仍然可以使用传统字符串或过时的允许字符串,但以前编写的格式是HTML5中所需的。还有一点需要注意的是,这个DTD将导致所有的现代浏览器 无效链接 改为切换到他们的标准(合规)模式,即使它们不支持HTML5。



以下是一些更多信息:



使用Doctype激活浏览器模式& 选择Doctype(同一页面)


万维网联盟(他们制定网络标准)


I use a fantastic javascript organization tree generator named "ECOTree" but the drawing does not work when I put <!DOCTYPE html>. Labels in the boxes are not put in the boxes correctly.

You can see the error at sample1.htm on the site below. Could anybody suggest me how to fix. http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=16192

(In order to follow my project rule, I have to define <!DOCTYPE html>)

解决方案

<!DOCTYPE html> is the explicit Document Type Declaration.

From the linked page:

The DOCTYPE Declaration (DTD or Document Type Declaration) does a couple of things:

  1. When performing HTML validation testing on a web page it tells the HTML (HyperText Markup Language) validator which version of (X)HTML standard the web page coding is supposed to comply with. When you validate your web page the HTML validator checks the coding against the applicable standard then reports which portions of the coding do not pass HTML validation (are not compliant).
  2. It tells the browser how to render the page in standards compliant mode.

#2 is a very important reason for using it.

<!DOCTYPE html>, specifically, is the correct declaration for HTML5, and should be used pretty much from here to the near future. You can still use legacy strings or obsolete permitted strings, but the previously written format is all that is required in HTML5. On a further note, this DTD will cause all modern browsers dead link to switch to their standards (compliance) mode, even if they don't support HTML5.

Here's some more info:

Activating Browser Modes with Doctype & Choosing a Doctype (same page)
World Wide Web Consortium (they make web standards)

这篇关于&quot;&lt;!DOCTYPE html&gt;&quot;这是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆