HTML页面中meta的相关配置

1. Keywords (关键字)

说明:告诉搜索引擎你网页的关键字是什么。
用法:

<meta name="keywords" content="***">
2. Description (网页描述)

说明:Description用来告诉搜索引擎你的网页主要内容。
用法:

<meta name="description" content="***" />
3. Robots (机器人向导)

说明:Robots用来告诉搜索机器人哪些页面需要索引,哪些页面不需要索引。Content的参数有all、none、index、noindex、follow、nofollow。默认是all。
用法:

<meta name="robots" content="All|None|Index|Noindex|Follow|Nofollow">

all:文件将被检索,且页面上的链接可以被查询;
none:文件将不被检索,且页面上的链接不可以被查询;(和 “noindex, no follow” 起相同作用)
index:文件将被检索;(让robot/spider登录)
follow:页面上的链接可以被查询;
noindex:文件将不被检索,但页面上的链接可以被查询;(不让robot/spider登录)
nofollow:文件将不被检索,页面上的链接可以被查询。(不让robot/spider顺着此页的连接往下探找)

4. Author (作者)

说明:标注网页的作者或制作组
用法:

<meta name="author" content="myname,myname@qq.com">

注意:Content可以是:你或你的制作组的名字,或Email

5. Copyright (版权)

说明:标注版权
用法:

<meta name="copyright" content="本网站版权归****所有">
6. Revisit-after (重访)

说明:通知搜索引擎多少天访问一次
用法:

<meta name="revisit-after" content="7 days" >
7. 移动端viewport标签
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">

width 设置layout viewport 的宽度,为一个正整数,或字符串"device-width" 为设备的宽度(单位为缩放为 100% 时的 CSS 的像素)。
initial-scale 设置页面的初始缩放值,为一个数字,可以带小数,是页面大小的一个乘数。例如,如果你设置初始缩放为“1.0”,那么,web页面在展现的时候就会以target density分辨率的1:1来展现。如果你设置为“2.0”,那么这个页面就会放大为2倍。
minimum-scale 允许用户的最小缩放值,为一个数字,可以带小数
maximum-scale 允许用户的最大缩放值,为一个数字,可以带小数
height 设置layout viewport 的高度,这个属性对我们并不重要,很少使用
user-scalable 是否允许用户进行缩放,值为 “no” 或 “yes”, no 代表不允许,yes 代表允许
所有的缩放值都必须在0.01–10的范围之内。

8. 禁止缓存
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">

禁止浏览器从本地计算机的缓存中访问页面内容,这样设定,访问者将无法脱机浏览。

9. 刷新、重定向
<meta http-equiv="refresh" content="30">

每30秒刷新页面

<meta http-equiv="Refresh" content="10;url=http://www.baidu.com" />

10秒后重定向到www.baidu.com

10. 禁止转码(百度官方)
<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
11. 指定网页兼容性模式
 <meta http-equiv="X-UA-Compatible" content="Chrome=1,IE=Edge" />

多核浏览器可以让浏览器使用最新引擎渲染

12. 告诉百度,网站类型

响应式:

<meta name="applicable-device" content="pc,mobile" />

PC站:

<meta name="applicable-device" content="pc" />

手机站:

<meta name="applicable-device" content="mobile" />
13. 渲染模式
<meta name="renderer" content="webkit">

移动端相关设置

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

telephone——主要作用是是否设置自动将你的数字转化为拨号链接;
email——告诉设备不识别邮箱,点击之后不发送
address——是否开启点击地址直接跳转地图的功能,默认开启。

开放配置适配移动端
<meta name="mobile-agent" content="format=html5; url=https://m.hxzg.com/" />

format:[wml|xhtml|html5]——根据手机页的协议语言,选择中的一种。
url=url ——后者代表当前PC页所对应的手机页url,两者必须是一一对应关系(而不是统一对应至手机站首页)
标注Meta声明这一适配方案仅限适用于百度移动搜索,即只有当用户通过百度移动搜索访问站点时,适配才会生效;通过其他渠道则不生效。

删除默认的苹果工具栏和菜单栏
<meta name="apple-mobile-web-app-capable" content="yes" />
设置默认苹果状态栏样式
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">

content:默认default(白色) 可以定制black(黑色)和black-translucent(灰色半透明)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值