用HTML5创建时开始标签的正确使用方法是什么
IE:HTML 4 Strict 是这样的
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
最佳答案
该标准已被简化,因为以前的文档类型过于隐晦。新的文档类型就是 <!DOCTYPE html>
.你可能想知道为什么它不是 <!DOCTYPE html5>
但这仅仅是因为它只是对 HTML 标准的更新,而不是任何新版本。正如您在下面看到的,所有元素现在都可以具有语言属性。
The
<html>
element is the root element of a document. Every document must begin with this element, and it must contain both the<head>
and<body>
elements.It is considered good practice to specify the primary language of the document on this element using the lang attribute.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Hello World</title>
</head>
<body>
<h1>Hello World</h1>
<p>
Jamie was here.
</p>
</body>
</html>
更多信息:https://dev.w3.org/html5/html-author/#doctype-declaration
关于html - 声明 HTML5 Doctype 的正确方法是什么。,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10963135/