html的<meta>用法_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:39:38
Original
1102 people have browsed it

meta标签提供关于HTML文档的元数据。元数据不会显示在页面上,但是对于机器是可读的。它可用于浏览器(如何显示内容或重新加载页面),搜索引擎(关键词),或其他 web 服务。
元素可提供相关页面的元信息(meta-information),比如针对搜索引擎和更新频度的描述和关键词。 标签位于文档的头部,不包含任何内容。 标签的属性定义了与文档相关联的名称/值对。

<meta name=”某个设置值” content=”对该设置值进行具体补充说明的信息”><meta http-equiv=”某个设置值” content=”对该设置值进行具体补充说明的信息”>
Copy after login

1, name属性的设置:
1).keywords:告诉搜索引擎,把content属性中填入的内容作为网页的关键字添加到搜索引擎中,content属性中的多个关键字可以使用逗号分隔,例如:

  <meta name=”keywords” content=”软件开发,java”>  
Copy after login

2),Description:搜索引擎使用content属性中的设置信息未做对网站的描述
3),Robots:告诉搜索引擎释放的robot或spider,根据content属性中的设置来决定采取什么样的行动方式。

Content的值可以是:

Index 可以检索和收录此页,这是默认值。
Noindex 是不让robot/spider检索和收录此页。
Follow 允许robot,spider顺着此页的超级链接往下探找。
Nofollow 是不让robot,spider顺着此页的超级链接往下探找。
All 告诉robot,spider可以检索和收录此页,而且可以顺着此页的超链接往下探找。
None 是既不让检索和收录此页,也不让robot,spider顺着此页顺着探找
4),author :用于说明网页的作者,content中填入网页的作者。
5)copyright:用于版权声明,content中填入你的版权声明。
6)generator:用于说明编辑此页所使用的工具的名称,content填入网页的编辑软件
2, http-equiv属性的设置:
1),content-type用于说明网页内容的MIME类型以及文本内容所使用的字符集编 码。

<meta http-equiv=”content-type” content=”text/html;charset=gb2312”>
Copy after login

2)Refresh用于告诉浏览器指定的某一时间段后自动对页面进行刷新,

 <meta http-equiv=”Refresh” content=”1”>    时间单位是;  秒 //也可以让浏览器在一定时间后跳到其他网页,时间值与URL之间用分号(;)分隔 <meta http-equiv=”Refresh” content=”1;url=http://www.163.com”>   
Copy after login

3):Expires用于设定网页的到期时间,超过了content属性中指定的日期浏览器必须到服务器上重新下载该网页。注意content属性中的设置值必须使用GMT时间格式

<meta http-equiv=”Expires” content=”Mon,12 May 2001 00:02:00 GMT”>  CONTENT设置为0,可以禁止浏览器使用缓存页面
Copy after login

4):Windows-Target强制页面在某个窗口中显示。要防止自己的网页别别人当作一个frame页面调用,可以使用

<meta http-equiv=”Windows-Target” content=”_top”>
Copy after login

5);Pragma用于设定禁止浏览器在本地计算机上缓存次页面,content属性设置为 no-cache

<meta http-equiv=”Cache-Control” content=”no-cache”>
Copy after login

6)Page-Enter:设置浏览器的特殊显示效果

<meta http-equiv=”Page-Enter”  content=”revealTrans(Transition=23,Duration=1.000)”> Duration表示滤镜特效的持续时间(单位:秒)Transition滤镜类型。表示使用哪种特效,取值为0-23:0 矩形缩小1 矩形扩大2 圆形缩小3 圆形扩大4 下到上刷新5 上到下刷新6 左到右刷新7 右到左刷新8 竖百叶窗9 横百叶窗10 错位横百叶窗11 错位竖百叶窗12 点扩散13 左右到中间刷新14 中间到左右刷新15 中间到上下16 上下到中间17 右下到左上18 右上到左下19 左上到右下20 左下到右上21 横条22 竖条23 以上22种随机选择一种
Copy after login

7):Page-Exit 设置浏览器离开某个网页时,所采取的特殊显示效果

版权声明:本文为博主原创文章,未经博主允许不得转载。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!