常用meta标签整理

常用meta标签列表,为了加强记忆,ytkah采用先放代码再放注释的形式,献给有需要的朋友们

<meta charset="utf-8">

  ↑↑↑ 设置页面编码为UTF8,防止乱码,需要页面保存为UTF8无BOM格式

 

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

  ↑↑↑ 这个属性常用于设计移动端网页

 

<meta http-equiv="X-UA-Compatible" content="IE=edge">

  ↑↑↑ 为IE设置兼容模式为edge

 

<meta name="keywords" content="关键词">
<meta name="description" content="描述">

  ↑↑↑ 页面关键词、描述

 

<meta name="robots" content="all">

  ↑↑↑ robots用来告诉爬虫哪些页面需要索引,哪些页面不需要索引。content的参数有all,none,index,noindex,follow,nofollow。默认是all。

具体参数如下:

1.none : 搜索引擎将忽略此网页,等价于noindex,nofollow。
2.noindex : 搜索引擎不索引此网页。
3.nofollow: 搜索引擎不继续通过此网页的链接索引搜索其它的网页。
4.all : 搜索引擎将索引此网页与继续通过此网页的链接索引,等价于index,follow。
5.index : 搜索引擎索引此网页。
6.follow : 搜索引擎继续通过此网页的链接索引搜索其它的网页。

<meta name="author" content="ytkah">

  ↑↑↑ 用于标注网页作者

 

<meta name="generator" content="PHPStorm">

  ↑↑↑ 用于标明网页是什么软件做的

 

<link rel="shortcut icon" href="/images/favicon.ico" type="image/x-icon"> 

  ↑↑↑ 显示并指定favicon图标的位置

 

<meta http-equiv="refresh" content="30">

  ↑↑↑ 网页将在设定的30秒后自动刷新

 

<meta http-equiv="refresh" content="5" url="https://www.cnblogs.com/ytkah">

  ↑↑↑ 网页将在设定的5秒时间后,自动刷新并调向设定的网址。

 

 其他一些标签

<meta name="copyright" content="本页版权归XX所有,All Rights Reserved."> 标注版权

<base href="http://www.xx.com/" target="_blank"> 为相对地址指定基地址,并设置为新窗口打开

<meta name="format-detection" content="telephone=no"> 禁止电话号码识别 

<meta name="format-detection" content="email=no"> 禁止邮箱识别 

<meta name="format-detection" content="adress=no"> 禁止识别地址和跳转到地图功能 

WebApp全屏模式:伪装app,离线应用。

<meta name="apple-mobile-web-app-capable" content="yes" /> <!-- 启用 WebApp 全屏模式 --> 

隐藏状态栏/设置状态栏颜色:只有在开启WebApp全屏模式时才生效。content的值为default | black | black-translucent 。

 

<meta name="apple-mobile-web-app-capable" content="yes"> 禁用工具栏与菜单栏,苹果系专属 

<meta name="apple-mobile-web-app-status-bar-style" content="default"> 状态栏为默认样式,苹果系专属 

<meta name="apple-mobile-web-app-status-bar-style" content="black"> 状态栏为黑色样式,苹果系专属 

<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"> 状态栏为灰色样式,苹果系专属 

<meta name="apple-mobile-web-app-status-bar-style" content="blank"> 隐藏状态栏,苹果系专属

转载于:https://www.cnblogs.com/ytkah/p/11544358.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值