html页面头部里的meta
作者:zccst
- 此属性出现在meta标签中
- 此属性用于代替name,HTTP服务器通过此属性收集HTTP协议的响应头报文
- 此属性的HTTP协议的响应头报文的值应使用content属性描述
http-equiv示例
- charset -- charset 定义编码信息
- refresh -- refresh 刷新与跳转网页
- no-cache -- HTML meta no-cache 定义页面缓存
- expires -- HTML meta expires 定义网页缓存过期时间
常用的http-equiv类型有:
<meta http-equiv="Content-Language" Content="zh-CN" />
该meta标签定义了HTML页面所使用的字符集为GB2132,就是国标汉字码。
如果将其中的“charset=GB2312"替换成“BIG5",则该页面所用的字符集就是繁体中文Big5码。
当你浏览一些国外的站点时,IE浏览器会提示你要正确显示该页面需要下载xx语支持。
这个功能就是通过读取HTML页面meta标签的Content-Type属性而得知需要使用哪种字符集显示该页面的。
如果系统里没有装相应的字符集,则IE就提示下载。
其他的语言也对应不同的charset,比如日文的字符集是“iso-2022-jp ",韩文的是“ks_c_5601"。
Charset选项:
ISO-8859-1(英文)、BIG5、UTF-8、SHIFT-Jis、Euc、Koi8-2、us-ascii,x-mac-roman, iso-8859-2, x-mac-ce, iso-2022-jp, x-sjis, x-euc-jp,euc-kr,iso-2022-kr, gb2312, gb_2312-80, x-euc-tw, x-cns11643-1,x-cns11643-2等字符集;
Content-Language的Content还可以是:EN、FR等语言代码。
<meta http-equiv="Expires" Content="Wed, 26 Feb 1997 08:21:57 GMT" />
当你希望访问者每次都刷新你广告的图标,或每次都刷新你的计数器,就要禁用缓存了。
通常HTML文件没有必要禁用缓存,对于ASP等页面,就可以使用禁用缓存,因为每次看到的页面都是在服务器动态生成的,缓存就失去意义。如果网页过期,那么存盘的cookie将被删除。
别就是通过该参数来设置的。
用户可以设置Microsoft Internet Explorer(IE3.0以上)来排除包含有色情和暴力内容的站点。
上面这个例子中的HTML取自Microsoft的主页。代码中的(n 0 s 0 v 0 l 0)表示该站点不包含不健康内容。
级别的评定是由RSAC,即美国娱乐委员会的评级机构评定的,如果你想进一步了解RSAC评估系统的等级内容,或者你需要评价自己的网站,可以访问RSAC的站点:http://www.rsac.org/。
<meta http-equiv="Page-Enter" Content="blendTrans(Duration=0.5)">
<meta http-equiv="Page-Exit" Content="blendTrans(Duration=0.5)">
<meta http-equiv="Page-Enter" Content="revealTrans(duration=x, transition=y)">
<meta http-equiv="Page-Exit" Content="revealTrans(duration=x, transition=y)">
<meta http-equiv="Page-Enter" CONTENT="revealtrans(duration=6.0, transition=23)">
<meta http-equiv="Page-Exit" CONTENT="revealtrans(duration=6.0, transition=23)">
把这两句加到<head> </head>中间
Transition滤镜类型。表示使用哪种特效,取值为0-23。
7 右到左刷新 8 竖百叶窗 9 横百叶窗 10 错位横百叶窗 11 错位竖百叶窗 12 点扩散
13 左右到中间刷新 14 中间到左右刷新 15 中间到上下 16 上下到中间 17 右下到左上
18 右上到左下 19 左上到右下 20 左下到右上 21 横条 22 竖条 23 以上22种随机选择一种
解释:Content=”No”关闭 xp 的蓝色立体按钮系统显示样式,从而和win2k 很象。
说明:在Microsoft IE 6 中有一个 Smart tag 开关,如果您包含下面标记,访问这将看不到某些相关连接,
这样可以避免访问者流失到竞争对手的网站上去。
并且把下面代码增加到你站点主页的 <head> 标签中,主要是为了方便搜索引擎来读取。
<link rel="alternate" type="application/rss+xml" title="ROR" href="sitemap.xml" />
<link rel="alternate" type="application/rss+xml" title="ROR" href="ror.xml" />
下面是一篇国外的文章
Meta Tags
Once upon a time, many eons ago, when the Internet was just a small number of cardboard boxes attached to each other with string, meta tags were the town criers of the Internet… erm… town.
Meta tags don’t do anything to the content that is presented in the browser window, but they are used by the likes of search engines to catalogue information about the web page.
There is one meta tag which can be used as many times as you desire inside a head element and they can contain the attributes charset, name, http-equiv, and content.
When the name or http-equiv attribute is used, the content attribute is then used in conjunction(结合) with them to apply meta data itself.
Names
The name attribute can be anything you like. The most commonly used names are author, description, and keywords. author is used to explicitly state one of the HTML page’s authors and description is often used by search engines (such as Google) to display a description of a web page in its search results.
The reason why meta tags used to be so important was because they were relied on by search engines to build a profile of a web page. The keywords meta data was used (and abused) extensively, for example. Nowadays, however, most search engines use the actual content of the page itself.
HTTP Equivalents
The http-equiv attribute can be used instead of the name attribute and will make an HTTP header, which is information sent to the server where the web page is held. The attribute should rarely be used (although see charset note, below) but the value can be:
content-type, an encoding declaration, defining what character set is being used,default-style, the preferred stylesheet from a selection oflinkorstyleelements,- or
refresh, which defines how often (in seconds) a page automatically refreshes or if it should automatically redirect to another page. Not great for accessibility.
The charset attribute can be used as a shorthand method to define an HTML document’s character set, which is always a good thing to do. <meta charset="utf-8"> is the same as <meta http-equiv="content-type" content="text/html; charset=utf-8">.
最关键的一语:<meta charset="utf-8">与<meta http-equiv="content-type" content="text/html; charset=utf-8">相同的,前者是后者的简写。
<head>
<title>Air conditioners? YEAH conditioners!</title>
<meta charset="utf-8">
<meta http-equiv="refresh" content="3"><!--not recommended for sane people-->
<meta name="description" content="This is my really, really, REALLY exciting web page about air conditioners">
...
html页面头部里的meta的更多相关文章
- 解剖SQLSERVER 第二篇 对数据页面头进行逆向(译)
解剖SQLSERVER 第二篇 对数据页面头进行逆向(译) http://improve.dk/reverse-engineering-sql-server-page-headers/ 在开发Orc ...
- 在Java中导出word、excel格式文件时JSP页面头的设置
我们在JSP中往往会把一些表格里的东西需要导出到本地,一般都是导成word.excel格式的文件.这只需要在JSP页面头设置及在<head></head>标签中添加下面的代码: ...
- 控制移动端页面的缩放(meta)
meta标签中的content属性里有一个width=device-width的值,这个值就是用来告诉浏览器,该页面将要使用设备的宽度来解析,后面的属性值则是告诉该页面: user-scalable= ...
- 手机页面head中的meta元素
<meta http-equiv="Pragma" content="no-cache"> <meta http-equiv="ex ...
- Drupal启动阶段之六:页面头信息
Drupal在本阶段为用户设置缓存头信息.Drupal不为验证用户缓存页面,每次请求时都是从新读取的. function _drupal_bootstrap_page_header() { boots ...
- 今天需要做手机端访问的页面,所以把meta的整理一下。
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale= ...
- html页面中meta的作用
meta是用来在HTML文档中模拟HTTP协议的响应头报文.meta 标签用于网页的<head>与</head>中,meta 标签的用处很多.meta 的属性有两种:name和 ...
- PHP 页面编码声明方法(header或meta)
本文为大家介绍了二种页面编码的声明方法,一种是使用php中的header函数来向客户端发送header头,一种是使用html中的meta标签来生明页面编码,本文分别对他们如何使用进行了说明,感兴趣的同 ...
- HTML 页面meta标签
1. 概述 1.1 说明 <meta>标签提供了HTML文档的元数据[元数据(Metadata)是数据的数据信息],即页面的元信息,元数据不会显示在客户端,但是会被浏览器解析.meta元素 ...
随机推荐
- POJ 2031 Building a Space Station 最小生成树模板
题目大意:在三维坐标中给出n个细胞的x,y,z坐标和半径r.如果两个点相交或相切则不用修路,否则修一条路连接两个细胞的表面,求最小生成树. 题目思路:最小生成树树模板过了,没啥说的 #include& ...
- map & flatMap 浅析
我之前一直以为我是懂 map 和 flatMap 的.但是直到我看到别人说:「一个实现了 flatMap 方法的类型其实就是 monad.」我又发现这个熟悉的东西变得陌生起来,本节烧脑体操打算更细致一 ...
- 解决UnicodeDecodeError: ‘ascii’ codec can’t decode byte 0xe5 in position 108: ordinal not in range(128
今天做网页到了测试和数据库交互的地方,其中HTML和数据库都是设置成utf-8格式编码,插入到数据库中是正确的,但是当读取出来的时候就会出错,原因就是python的str默认是ascii编码,和uni ...
- 学习笔记——门面模式Facade
门面模式,其实在我们不经意间已经使用了此设计模式.当我们需要将两个子系统,合并对外提供一个大的接口时,我们使用的就是门面模式.对外,子系统的接口是不可见的,只有我们的门面在.
- CenOS下LAMP搭建过程
CentOS虚拟机中安装LAMP: Linux+Apache+MySQL+PHP 安装前先关闭防火墙和Selinux 把所有安装包解压到/lamp下(根目录下的lamp目录) 安装gcc, gcc-c ...
- HDU - 1865 1string(大数)
题目链接:http://acm.hust.edu.cn/vjudge/contest/121397#problem/F http://acm.hdu.edu.cn/showproblem.php?pi ...
- 教你用CSS代码写出的各种形状图形
做网页设计时经常要用到各种形状的图形,对于规则的图形很简单,但是对于不规则的图形,一般我们都是用图片,今天就在这里教大家怎样用css代码写出各种规则不同的图形 1.正方形 #square {width ...
- 如何在Apache中配置多端口访问
环境: Windows server 2008 R2, Apache, PHP5 步骤: 建立一个目录,里面放置一个index.php. 打开Apache\conf\httpd.conf 文件,做如下 ...
- php源码分析之PHPAPI宏的作用
在PHP源码中,我们经常会看到很多函数前面有个PHPAPI,但这是什么呢? 于是我在php源码/main/php.h中找到了它的定义 #ifdef PHP_WIN32 # include " ...
- i2c的时钟延展问题(转)
源:http://blog.csdn.net/zyboy2000/article/details/7636769 结论: (即在模拟i2c主:在主设置SCL为高后,要超时判断SCL是否为高,再发后面的 ...