Meta标记详解

来自CloudWiki
跳转至: 导航搜索
  • meta标记主要记录网页的一些基础信息,现在能记录这样一些:

标注网页的编码

  • <meta charset=“UTF-8”/> 代表世界通用的语言编码;
  • <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  • <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

标注网页的作者和关键词

  • 使用Name属性设置搜索内容名,如author 、keywords、description等,而content属性对应搜索内容值。
  • <META name = “author” content = “王爱华">
  • <META name = “keywords” content = “图书,计算机,网页编程">
  • <META name = “discription” content = “这是清华大学出版社的相关介绍">


标注http头部信息

  • 使用http-equiv/content参数可设置服务器发送给浏览器的http头部信息,为浏览器显示该页面提供相关参数.
  • <META http-equiv=“content-type" content=“text/html"> 通知浏览器文档类型是html文档
  • <META http-equiv="refresh" content=“2"> 表示每隔2秒,自动刷新网页
  • <META http-equiv="refresh" content=“5;url=http://mail.163.com”> 间隔5秒后,自动刷新到163网站首页
  • <META http-equiv=“expires" content=“2012-12-31 23:59:59”> 访问过包含该信息的页面后,该页面将在浏览器中缓存到指定时间