头部标签(<head></head>内的标签)

【Meta】

Meta标签分两大部分:HTTP标题信息(http-equiv)和页面描述信息(name)

(1)  http-equiv类似于http的头部协议,它回应给浏览器一些有用的信息,以帮助正确和精确地显示网页内容。常用的http-equiv类型有:

  ①   content-type和content-language(显示字符集的设定)

    <meta http-equiv="content-type" content="text/html;charset=utf-8">

    <meta http-equiv="content-language" content="zh-CN/EN/FR">

    (charset-字符集;gb2312-国标汉字码;big5-繁体中文码;utf-8;)

  ②   refresh(刷新)

    10秒后自动刷新一次:<meta http-equiv="refresh" content="10">

    10秒后自动跳转到另一文件:

      <meta http-equiv="refresh" content="10;url='欲连接文件的url' ">

  ③   page-enter/page-exit(页面载入或调出时的特效)

         <meta http-equiv="page-enter" content="blendtrans(duration=0.5)">

         <meta http-equiv="page-exit" content="blendtrans(duration=0.5)">

             (blendtrans是动态滤镜的一种,产生渐隐效果)

         Revealtrans效果

    <meta http-equiv="page-enter" content="revealtrans(duration=#,transition=#)">

    <meta http-equiv="page-exit" content="revealtrans(duration=#,transition=#)">

      (duration表示滤镜特效持续时间(秒);transition表示滤镜类型(0~23))

  ④   content-script-type(脚本相关)

          <meta http-equiv="content-script-type" content="text/javascript">

           W3C的规范,指明页面中脚本的类型

  ⑤   http-equiv="pics-Label"时,content表示页面内容的等级

    ⑥  http-equiv="expires"时,content表示页面过期的日期

(2)  name是描述网页的,对应于content(网页内容),以便于搜索引擎机器人查找分类

  (目前几乎所有的搜索引擎都使用网上机器人自动查找meta值来给网页分类)

     <meta name="keywords" content="关键词1,关键词2,关键词3,…">

     <meta name="keywords" lang="EN" content="vacation,greece,sunshine">

     <meta name="keywords" lang="FR" content="vacances,grè:ce,soleil">

      (meta通常的作用是指定搜索引擎用来提高搜索质量的关键词,当数个meta元素提供文档语言从属信息时,搜索引擎会使用lang特性来过滤并通过客户的语言优先参照来显示搜索结果)

     <meta name="description" content="网页简述">

  (将网页主页内容提交搜索引擎)

     <meta name="robots" content="all/none/index/noindex/follow/nofollow">

      (告诉搜索机器人哪些页面需要索引,哪些不需要)

         all:文件将被检索,且页面上的链接可以被查询

         none:文件将不被检索,且页面上的链接不可以被查询(和noindex/nofollow相同)

         index:文件将被检索(让robot/spider登录)

         noidex:文件将不被检索,但页面上的链接可以被查询;(不让robot/spide登录)

         nofollow:文件将不被检索,页面上的链接可以被查询。(不让robot/spider顺着此页的连接往下探找)

     作者(author)<meta name="author" content="xxx,[email protected]">

     版权(copyright)<meta name="copyright" content="本页版权归xxx所有All Rights Reserved">

 

猜你喜欢

转载自www.cnblogs.com/zhouwanqiu/p/8855839.html