目前我在每个页面上都有<meta http-equiv="content-type" content="text/html; charset=UTF-8" />.人们是否仍然包含关键字,描述和作者等元标记?如果是这样,他们应该在每个HTML页面上还是只在主页上?
嗯,你挑衅应该有meta charset
<meta charset="utf-8">
Run Code Online (Sandbox Code Playgroud)
不需要http-equiv,因为它表示HTTP头等效.但是对于Web,通过Web服务器(可能是apache)提供的Content-Type HTTP头应该这样做.您可以通过.htaccess或使用PHP header()函数覆盖服务器默认值.
包含也不是一个坏主意
<meta name="description" content="">
<meta name="author" content="">
Run Code Online (Sandbox Code Playgroud)
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">
Run Code Online (Sandbox Code Playgroud)
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">
Run Code Online (Sandbox Code Playgroud)
http://html5boilerplate.com/docs/#The-markup★mobile-viewport--creating-a-mobile-version