mate标签

来源:互联网 发布:环太平洋配乐 知乎 编辑:程序博客网 时间:2024/06/10 08:17

mate标签

提供页面的元信息但和内容无关,元数据可以被浏览器、搜索引擎和其他web服务器使用

mate两种属性:http-equiv和name

  • http-equiv 相当于HTTP头

    • content-type 定义文档的字符集
      <meta http-equiv="content-Type" content="text/html;charset=utf-8">
      <meta charset="utf-8">
    • expires 网页到期时间
      <meta http-equiv="expires" content="Fri, 12 Jan 2001 18:18:18 GMT">
    • X-UA-Compatible 浏览器采取何种版本渲染当前页面
      <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> //指定IE和Chrome使用最新版本渲染当前页面
    • cache-control 指定请求和响应遵循的缓存机制
    • refresh 自动刷新,病指向某个页面
      <meta http-equiv="Refresh" content="2; URL=http://www.root.net">
    • set-cookie 设置cookie
      <meta http-equiv="Set-Cookie" content="cookievalue=xxx; expires=Friday,12-Jan-2001 18:18:18 GMT; path=/">
    • cleartype 只对IE有用,用于平滑字体,不推荐使用
      <!--[if IEMobile]><meta http-equiv="cleartype" content="on"><![endif]-->
  • name 描述网页

    • author 作者
      <meta name="author" content="xx@xx">
    • description 描述,网站主要内容
      <meta name="description" content="This page is about">
    • keywords 关键字,搜索引擎会使用这些关键字分类
      <meta name ="keywords" content="science, education">
    • renderer 双核浏览器渲染方式,指定以哪种渲染方式
      <meta name="renderer" content="webkit">
    • viewport 视口,定义设备的大小
      <meta name="viewport" content="width=device-width,initial-scale=1">
    • HandheldFriendly 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓
      <meta name="HandheldFriendly" content="True">
    • MobileOptimized 微软为IE Mobile版设置的定义宽度标记
      <meta name="MobileOptimized" content="320">
    • apple-mobile-web-app-capable 是否启动webapp功能(全屏),会删除默认的苹果工具栏和菜单栏。
    • apple-mobile-web-app-capable
      <meta name="apple-mobile-web-app-capable" content="yes">
    • apple-mobile-web-app-status-bar-style 当启动webapp功能时,手机顶部导航栏的颜色
      <meta name="apple-mobile-web-app-status-bar-style" content="black">
    • apple-mobile-web-app-title 添加到主屏后的标题
      <meta name="apple-mobile-we-app-title" content="">
    • format-detection 格式检测,识别页面中的电话号码
      <meta name="format-detection" content="telephone=no">
    • format-detection 格式检测,识别页面中的email
      <meta name="format-detection" content="email=no">
0 0
原创粉丝点击