Meta标签 h5
一 PC端meta标签
1 页面关键词
<meta name="keywords" content="your tags">
2 页面描述
<meta name="description" content="150 words">
3 搜索引擎方式:robotterms是一组使用(,)分割的值,通常有如下几种取值:none,noindex,nofollow,index,follow,all
<meta name="robots" content="index,follow"/>
all:文件将被检索,且页面上的连接可以被查询;
none:文件不将被检索,且页面上的连接不可以查询;
index:文件将被检索;
follow:页面上的连接将被查询;
noindex:文件将不被检索;
nofollow:页面上的连接不可以被查询;
4 页面重定向和刷新:content内的数字代表时间 秒,既多长时间后刷新。如果加url则会重新定向到制定网页(搜索引擎能够自动检测,也很容易呗引擎视作误导)
<meta http-equiv="refresh" content="0;url="/>
二 页面缓存设置meta标签——清除缓存
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache"/>
<meta http-equiv="expires" content="0"/>
三 基础meta标签
1、HTML页面结构
<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
width 设置viewport宽度,为一个正整数,或字符串‘device-width’
height 设置viewport高度,一般设置了宽度,会自动解析出高度,可以不用设置
initial-scale 默认缩放比例,为一个数字,可以带小数
minimum-scale 允许用户最小缩放比例,为一个数字,可以带小数
maximum-scale 允许用户最大缩放比例,为一个数字,可以带小数
user-scalable 是否允许手动缩放
2 、JS动态判断
var phoneWidth = parseInt(window.screen.width);
var phoneScale = phoneWidth/640;
var ua = navigator.userAgent;
if (/Android (\d+\.\d+)/.test(ua)){ var version = parseFloat(RegExp.$1);
if(version>2.3){ document.write('<meta name="viewport" content="width=640, minimum-scale = '+phoneScale+', maximum-scale = '+phoneScale+', target-densitydpi=device-dpi">'); }else{ document.write('<meta name="viewport" content="width=640, target-densitydpi=device-dpi">'); } } else { document.write('<meta name="viewport" content="width=640, user-scalable=no, target-densitydpi=device-dpi">'); }
3、JS动态判断
设置缩放:<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui" />
可隐藏地址栏,仅针对IOS的Safari(注:IOS7.0版本以后,safari上已看不到效果: <meta name="apple-mobile-web-app-capable" content="yes" />
仅针对IOS的Safari顶端状态条的样式:(可选default/black/black-translucent <meta name="apple-mobile-web-app-status-bar-style" content="black" />
IOS中禁用将数字识别为电话号码/忽略Android平台中对邮箱地址的识别: <meta name="format-detection"content="telephone=no, email=no" />
四 其他meta标签
1 启用360浏览器的急速模式
<meta name="renderer" content="webkit"/>
2 避免IE使用兼容模式
<meta http-equiv="X-UA-Compatible" content="IE=edge">
3 针对手持设备优化,主要针对一些老的不识别viewpoint的浏览器比如黑莓
<meta name="HandheldFriendly" content="true">
4 微软老式浏览器
<meta name="MobileOptimized" content="320">
5 UC强制竖屏
<meta name="screen-orientation" content="portrait">
6 QQ强制竖屏
<meta name="x5-orientation" content="portrait">
7 UC强制全屏
<meta name="full-screen" content="yes">
8 QQ强制全屏
<meta name="x5-fullscreen" content="true">
9 UC应用模式
<meta name="browsermode" content="application">
10 QQ应用模式
<meta name="x5-page-mode" content="app">
11 windows phone 点击无高光
<meta name="msapplication-tap-highlight" content="no">
12 定义网页作者
<meta name="author" content="author name" />
<meta name="google" content="index,follow" />
<meta name="googlebot" content="index,follow" />
<meta name="verify" content="index,follow" />
Meta标签 h5的更多相关文章
- h5标签基础 meta标签
<meta>标签位于<head>标签里面,具体作用有如下: 1.设置网页编码 eg: <meta charset="utf-8"/> ,//u ...
- 手机H5移动端WEB资源整合之meta标签
一.相关网站使用meta的实例 youku首页的Meta设置: <meta charset="utf-8"> <meta http-equiv="X-U ...
- H5 meta标签常用写法
<meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content=" ...
- HTML <meta> 标签,搜索引擎
关于Mate标签的详尽解释,请查看w3school 网址为:http://www.w3school.com.cn/tags/tag_meta.asp meta标签作用 META标签是HTML标记HEA ...
- html meta标签使用总结
meta标签作用 META标签是HTML标记HEAD区的一个关键标签,提供文档字符集.使用语言.作者等基本信息,以及对关键词和网页等级的设定等,最大的作用是能够做搜索引擎优化(SEO). PS:便于搜 ...
- 深入理解css系列:meta标签
积累太少,时间管理技巧欠缺,所以导致了博客更新的速度迟缓.学习中成长,成长中学习.加油吧!最近在做h5的项目,对于meta标签层出不穷的各式属性值有点头晕,所以查资料整理了下. 关键字:meta na ...
- 浅析网站开发中的 meta 标签的作用
*:first-child { margin-top: 0 !important; } body>*:last-child { margin-bottom: 0 !important; } /* ...
- 移动端meta标签整理-备
分类 在介绍移动端特有 meta 标签之前,先简单说一下 HTML meta 标签的一些知识. meta 标签包含了 HTTP 标题信息 (http-equiv) 和 页面描述信息 (name). h ...
- 【微信小程序项目实践总结】30分钟从陌生到熟悉 web app 、native app、hybrid app比较 30分钟ES6从陌生到熟悉 【原创】浅谈内存泄露 HTML5 五子棋 - JS/Canvas 游戏 meta 详解,html5 meta 标签日常设置 C#中回滚TransactionScope的使用方法和原理
[微信小程序项目实践总结]30分钟从陌生到熟悉 前言 我们之前对小程序做了基本学习: 1. 微信小程序开发07-列表页面怎么做 2. 微信小程序开发06-一个业务页面的完成 3. 微信小程序开发05- ...
随机推荐
- MongoDB小结24 - 索引简介2
索引的名字 集合中每个索引都有一个字符串类型的名字,来唯一标识索引. 服务器通过名字来操作或者删除索引. 要注意的是,索引名有字符个数限制,所以索引创建时一定要用自定义的名字,如 db.user.en ...
- myloader恢复mysql数据库演示样例
mydumper是针对mysql数据库备份的一个轻量级第三方的开源工具.备份方式为逻辑备份.它支持多线程.备份速度远高于原生态的mysqldump以及众多优异特性.与其相配套的恢复工具则是mylo ...
- 『NSOperation、NSOperationQueue』详解
1. NSOperation.NSOperationQueue 简介 NSOperation.NSOperationQueue 是苹果提供给我们的一套多线程解决方案.实际上 NSOperation.N ...
- linux 下查看一个进程执行路径
在linux下查看进程大家都会想到用 ps -ef|grep XXX 但是看到的不是全路径.怎么看全路径呢? 每一个进程启动之后在 /proc以下有一个于pid相应的路径 比如:ps -ef|grep ...
- HDU 1226 超级password
跟POJ 1465 multiple 类是.仅仅只是多了2个条件,长度不能超过500.还有就是 可能不是十进制. bfs+同余定理,就是用 mod 来判重. G++ 15ms 每次枚举一位,然后记录下 ...
- nginx-Proxy Cache缓存
1.创建目录 mkdir /export/Data/nginx_proxy_cache mkdir /export/Data/nginx_proxy_temp 2.修改http,打开缓存 文件 ...
- 项目实战之poi导出excel
所需jar包 官方下载地址:http://mirrors.hust.edu.cn/apache/poi/release/bin/poi-bin-3.17-20170915.zip 1.前端调用方法: ...
- projecteuler---->problem=12----Highly divisible triangular number
title: The sequence of triangle numbers is generated by adding the natural numbers. So the 7th trian ...
- Centos7 防火墙firewalld配置
开启80端口 firewall-cmd --zone=public --add-port=80/tcp --permanent 出现success表明添加成功 移除某个端口 firewall-cmd ...
- fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
project->xx Properties->Manifest->Input and Output->Embed Manifest将yes修改为no