Html5 meta标签用法总结

meta元素共有三个可选属性(http-equiv、name和scheme)和一个必选属性(content),content定义与 http-equiv 或 name 属性相关的元信息。
可选属性

属性 描述
http-equiv content-type / expire / refresh / set-cookie 把content属性关联到HTTP头部
name author / description / keywords / generator / revised / others 把 content 属性关联到一个名称
scheme some_text 定义用于翻译 content 属性值的格式

必选属性

属性 描述
content some_text 定义与 http-equiv 或 name 属性相关的元信息

name属性


<meta name="author" content="7ge"/>

<meta name="description" content="这里添加对页面的描述"/>

<meta name="keywords" content="meta标签总结,meta标签,7ge"/>

<meta name="generator" content="hexo" />

<meta name="revised" content="story,2015/07/22" />

<meta name="copyright" content="All Rights Reserved" />

<meta name="robots" content="index,follow" />






http-equiv


<meta http-equiv="content-type" content="text/html;charset=UTF-8"/>html5中可以改写成:<meta charset="utf-8"/>  

<meta http-equiv="expire" content="Wed,22Jul201511:11:11GMT" />

<meta http-equiv="refresh" content="0;URL=''" />

<meta http-equiv="set-cookie" content="cookiename value=xxx;expires=Wed,22-Jul-201511:11:11GMT;path=/" />

<meta http-equiv="Content-Script-Type"Content="text/javascript"/>

<meta http-equiv="Pragma"content="no-cache"/> 

移动端


<meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no"/>








<meta name="screen-orientation" content="portrait"/>

<meta name="x5-orientation" content="portrait"/>

<meta name="full-screen" content="yes"/>

<meta name="x5-fullscreen" content="true"/>

<meta name="browsermode" content="application"/>

<meta name="x5-page-mode" content="app"/>


<meta name="apple-mobile-web-app-capable" content="yes" />

<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />

<meta name="apple-mobile-web-app-title" content="标题"/>
!-- IOS添加智能 App 广告条 Smart App Banner -->
<meta name="apple-itunes-app" content="app-id=myAppStoreID, affiliate-data=myAffiliateData, app-argument=myURL">


<meta name="format-detection" content="telephone=no">

<meta name="format-detection" content="email=no">

<meta name="format-detection" content="adress=no">

<meta name="format-detection" content="telephone=no,email=no,adress=no">

谢谢各位读者补充!

你可能感兴趣的:(Html5 meta标签用法总结)