我使用一个名为“ECOTree”的梦幻般的
JavaScript组织树生成器,但是当我将<!DOCTYPE html> ;.盒子中的标签没有正确放入盒子中. 您可以在下面的站点上的sample1.htm中看到错误.有人可以建议我如何解决.
http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=16192
http://www.codeproject.com/script/Articles/ViewDownloads.aspx?aid=16192
(为了遵循我的项目规则,我必须定义<!DOCTYPE html>)
解决方法
<!DOCTYPE html>是明确的
Document Type Declaration.
The DOCTYPE Declaration (DTD or Document Type Declaration) does a couple of things:
- 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).
- It tells the browser how to render the page in standards compliant mode.
#2是使用它的一个非常重要的原因.
<!DOCTYPE html> ;,具体来说,是correct declaration for HTML5,应该从这里到不久的将来都会使用.您仍然可以使用遗留字符串或过时的允许字符串,但是以前写入的格式是HTML5中必需的.另外要注意的是,即使不支持HTML5,此DTD也会导致所有现代浏览器dead link至switch to their standards (compliance) mode.
这里有一些更多的信息:
Activating Browser Modes with Doctype& Choosing a Doctype (same page)
World Wide Web Consortium(他们制作网络标准)