关于头文件的一些经常使用

1、常见的<meta>(摘自百度)html

1.web

设置编码信息<meta http-equiv="Content-Type" Content="text/html; Charset=utf-8" />chrome

设置语言<meta http-equiv="Content-Language" Content="zh-CN" /> windows

设置重定向 <meta http-equiv="Refresh" Content="15; Url=http://www.baidu.com" /> 浏览器

设置缓存时间 <meta http-equiv="Expires" Content="Web, 26 Jun 2015 18:21:57 GMT" /> 缓存

不使用缓存 <meta http-equiv="Pragma" Content="No-cach" /> app

设置关键字 <meta name="Keywords" Content="key1,key2,..." /> 优化

设置描述信息 <meta name="Description" Content="description abc" />ui

设置对搜索引擎抓取 <meta name="Robots" Content="All|None|Index|Noindex|Follow|Nofollow" /> 搜索引擎

设置可视区域 <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" /> 

2.浏览器使用:  

<!-- 国产浏览器内核选择 --> <meta name="renderer" content="webkit|ie-comp|ie-stand">

 <!-- 使用最新版的ie浏览器,或者chrome--> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> 
<!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,好比黑莓 -->

 <meta name="HandheldFriendly" content="true">

 <!-- 微软的老式浏览器 --> <meta name="MobileOptimized" content="320"> 

<!-- uc强制竖屏 --> <meta name="screen-orientation" content="portrait"> 

<!-- QQ强制竖屏 --> <meta name="x5-orientation" content="portrait">

 <!-- UC强制全屏 --> <meta name="full-screen" content="yes"> 

<!-- QQ强制全屏 --> <meta name="x5-fullscreen" content="true"> 

<!-- UC应用模式 --> <meta name="browsermode" content="application">

 <!-- QQ应用模式 --> <meta name="x5-page-mode" content="app"> 

<!-- windows phone 点击无高光 --> <meta name="msapplication-tap-highlight" content="no">

 <!-- 禁止转码 --> <meta http-equiv="Cache-Control" content="no-siteapp" /> 

2、tabindex属性(摘自W3C):

一、做用:规定元素的tab键控制次序;

二、支持该属性的标签:

<a>,<area>,<button>,<object>,<select>,<textarea>,<meta>

三、示例:

 

<!DOCTYPE html>
<html>
<body>

<a href="http://www.w3school.com.cn/" tabindex="2">W3School</a><br />
<a href="http://www.google.com/" tabindex="1">Google</a><br />
<a href="http://www.microsoft.com/" tabindex="3">Microsoft</a>

<p><b>注释:</b>请尝试使用键盘上的 "Tab" 键在连接之间进行导航。</p>

</body>
</html>

 3、<meta name="renderer" content="webkit">

content的取值为webkit,ie-comp,ie-stand之一,区分大小写,分别表明用webkit内核,IE兼容内核,IE标准内核。 


若页面需默认用极速核,增长标签:<meta name="renderer" content="webkit"> 
若页面需默认用ie兼容内核,增长标签:<meta name="renderer" content="ie-comp"> 
若页面需默认用ie标准内核,增长标签:<meta name="renderer" content="ie-stand"> 
各渲染内核的技术细节 

内核 Webkit IE兼容 IE标准
文档模式 Chrome 21 IE6/7 IE9/IE10/IE11(取决于用户的IE)
HTML5支持 YES NO YES
ActiveX控件支持 NO YES YES
相关文章
相关标签/搜索