一.DOCTYPE
最新 HTML5 推出更加简洁的书写,它向前向后兼容。不区分大小写,前面没有任何内容,如果有其他内容(空格除外)会使浏览器在 IE 下开启怪异模式(quirks mode)渲染网页
二.charset
声明文档使用的字符编码<meta charset="utf-8">
三.lang属性
<html lang=en>
<html lang="zh-cmn-Hans">
四.优先使用 IE 最新版本和 Chrome
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
360 使用Google Chrome Frame,如果安装了 Google Chrome Frame,则使用 GCF 来渲染页面,如果没有安装 GCF,则使用最高版本的 IE 内核进行渲染。
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
五.百度禁止转码
<meta http-equiv="Cache-Control" content="no-siteapp" />
六.viewport
viewport
可以让布局在移动浏览器上显示的更好。 通常会写
<meta name="viewport" content="width=device-width, initial-scale=1.0">
七.移动端的meta
八.全屏
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black"> <meta content="telephone=no" name="format-detection"> <meta name="full-screen" content="yes"> <meta name="browsermode" content="application">