问题描述
在使用HTML5创建时使用开始标记的正确方法是什么?
What is the correct way to use start tag when creating with HTML5
IE:HTML 4 Strict是这样的
IE: HTML 4 Strict is like this
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
推荐答案
标准已被简化,因为之前的文档类型也是如此神秘。新的文档类型只是<!DOCTYPE html>
。您可能想知道为什么它不是<!DOCTYPE html5>
,但它仅仅是因为它只是HTML标准的更新而不是新版本的任何东西。您可以在下面看到,所有元素现在都可以拥有语言属性。
The standard has been simplified because the previous doctypes were too cryptic. The new doctype is simply <!DOCTYPE html>
. You may wonder why it is not <!DOCTYPE html5>
but it is simply because it is just an update to the standard of HTML and not a new version of anything. As you can see below, all elements can now have a language attribute.
使用lang属性在这个元素上指定
文档的主要语言被认为是一种很好的做法。 / p>
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>
更多信息:
这篇关于声明HTML5 Doctype的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!