zoukankan      html  css  js  c++  java
  • 关于HTML中<meta>标签的使用。

    <meta> 元素可提供有关页面的元信息.

    属性有charset name http-equiv content。charset 用于指定网页字符编码方式,常设置为utf-8。name,http-equiv分别与content组成键值对。

    1,name 常用的取值有:keywords,description,robots,author等。

      keywords用来设置搜索引擎网页的关键词是什么。

      description用来设置网站的主要内容。

      robots用来告诉机器人那些需要索引,那些不需要。

      author标注网页的作者。

    例如:

    <meta name="keywords" content="前端,web,HTML,CSS,Javascript" >
    <meta name="description" content="这是一个关于前端的网页" >
    <meta name="robots" content="all" >//可取值:all,none,index,noindex,follow,nofollow

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

      设定为none:文件将不被检索,且页面上的链接不可以被查询;

      设定为index:文件将被检索;

      设定为follow:页面上的链接可以被查询;

      设定为noindex:文件将不被检索,但页面上的链接可以被查询;

      设定为nofollow:文件将不被检索,页面上的链接可以被查询。 

    <meta name="author" content="Chang,changql09@163.com" >

    2,http-equiv 常用的取值有:expires,pragma,refresh,set-cookie,windows-Targe

      expires设置网页过期期限,(GMT时间格式)

      pragma禁止浏览器在本地调阅页面内容,这样只能在线浏览,

      set-cookie设定cookie存在的日期;

      windows-Targe强制页面在当前窗口中以独立页面显示,可以防止自己的网页被别人当作一个frame页调用

    <meta http-equiv="Refresh" contect="n;url=http://yourlink">定时让网页在指定的时间n内,跳转到页面http://yourlink;
    <meta http-equiv="Expires" contect="Mon,12 May 2001 00:20:00 GMT">
    <meta http-equiv="Pragma" contect="no-cache">是用于设定禁止浏览器从本地机的缓存中调阅页面内容,设定后一旦离开网页就无法从Cache中再调出;
    <meta http-equiv="set-cookie" contect="Mon,12 May 2001 00:20:00 GMT">
    <meta http-equiv="windows-Target" contect="_top">
    
     
  • 相关阅读:
    TCP Socket 粘包
    Toast连续弹出的问题
    SDK Build Tools revision (19.0.3) is too low for project Minimum required is 19.1.0
    数据结构精要------直接选择和堆排序算法
    hdoj 2199 Can you solve this equation? 【二分枚举】
    云端数据遭觊觎 安全问题不容忽视
    leetcode || 58、Length of Last Word
    【安全加密技术】非对称加密
    无处不在的微创新——验证码的故事
    IDLE经常使用快捷键汇总
  • 原文地址:https://www.cnblogs.com/kirinchang/p/4321925.html
Copyright © 2011-2022 走看看