目前我在每一页上只有 <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
.人们是否仍然包含关键字、描述和作者等元标记?如果是这样,它们应该出现在每个 HTML 页面上还是只出现在主页上?
最佳答案
好吧,你绝对应该拥有元字符集
<meta charset="utf-8">
不需要 http-equiv,因为它表示 HTTP header 等效项。然而,对于 Web,通过 Web 服务器(可能是 Apache)提供的 Content-Type HTTP header 应该可以。您可以通过 .htaccess 覆盖服务器默认值或使用 PHP header() 函数。
包含也是一个不错的主意
<meta name="description" content="">
<meta name="author" content="">
Paul Irish 的 html5 样板也推荐使用:
<!-- Always force latest IE rendering engine (even in intranet) this if you use the .htaccess -->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
http://html5boilerplate.com/docs/#The-markup★make-sure-the-latest-version-of-ie-is-used
<!-- Mobile viewport optimized: j.mp/bplateviewport -->
<meta name="viewport" content="width=device-width, initial-scale=1.0">
http://html5boilerplate.com/docs/#The-markup★mobile-viewport--creating-a-mobile-version
关于html - 现代网站应包含哪些元标记?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5290293/