<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>程默的博客 &#187; meta</title>
	<atom:link href="http://blog.chacuo.net/tag/meta/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.chacuo.net</link>
	<description>web原理、web架构、web安全、web性能、服务器性能、服务器架构、服务器安全;你不能预知明天，但你可以利用今天。你不能样样顺利，但你可以事事尽力!</description>
	<lastBuildDate>Mon, 31 Aug 2020 15:33:40 +0000</lastBuildDate>
	<language>zh-CN</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>meta标签 使用说明（http-equiv、refresh、seo）</title>
		<link>http://blog.chacuo.net/332.html</link>
		<comments>http://blog.chacuo.net/332.html#comments</comments>
		<pubDate>Thu, 11 Jul 2013 11:57:45 +0000</pubDate>
		<dc:creator>程默</dc:creator>
				<category><![CDATA[web原理]]></category>
		<category><![CDATA[html标签]]></category>
		<category><![CDATA[meta]]></category>

		<guid isPermaLink="false">http://blog.chacuo.net/?p=332</guid>
		<description><![CDATA[meta标签，是在head标签里面，一般用做页面描述的。它的内容，用来描述页面一些信息的，如类型、编码、作者、 [...]]]></description>
				<content:encoded><![CDATA[<p>meta标签，是在head标签里面，一般用做页面描述的。它的内容，用来描述页面一些信息的，如类型、编码、作者、简介等！虽然，它不作为页面布局显示，但实际上用途非常广的！具体的html定义在：<a href="http://www.w3.org/TR/html401/struct/global.html#h-7.4.4" target="_blank">meta定义</a>&#160;</p>
<p> <strong>meta组成部分</strong>
<p>meta标签共有两个属性，它们分别是http-equiv属性和name属性，不同的属性又有不同的参数值，这些不同的参数值就实现了不同的网页功能。</p>
<blockquote><p>name属性主要用于描述网页，与之对应的属性值为content，content中的内容主要是便于搜索引擎机器人查找信息和分类信息用的。</p>
<p>http-equiv相当于http的文件头作用，它可以向浏览器传回一些有用的信息，以帮助正确和精确地显示网页内容，与之对应的属性值为content，content中的内容其实就是各个参数的变量值。</p>
</blockquote>
<p> <strong>Meta标签属性</strong><br />
<blockquote>
<table class="table" border="1" rules="all" cellspacing="0" width="98%" frame="box">
<thead>
<tr valign="top">
<th width="20%">属性</th>
<th width="40%">值</th>
<th width="40%">描述</th>
</tr>
</thead>
<tbody>
<tr valign="top">
<td>http-equiv</td>
<td>content-type            <br />Content-Language             <br />Pragma             <br />expires             <br />refresh             <br />set-cookie </td>
<td>把 content 属性关联到 HTTP 头部。http协议返回头，都支持！</td>
</tr>
<tr valign="top">
<td>name</td>
<td>author            <br />description             <br />keywords             <br />generator             <br />revised             <br />others </td>
<td>把 content 属性关联到具体属性的值</td>
</tr>
<tr valign="top">
<td>content</td>
<td>对应（name,http_equiv）选择属性的值</td>
<td>定义与 http-equiv 或 name 属性相关的元信息。</td>
</tr>
</tbody>
</table>
</blockquote>
<p> <strong>http-equiv response返回头控制</strong>
<p>常用来说明页面类型、编码，重定向，以及缓存控制方面！ </p>
<blockquote><p>1、Content-Type和Content-Language (显示字符集的设定)      </p>
<p>&lt;meta http-equiv=″content-Type″ content=″text/html; charset=gb2312″&gt;，当前页面是text/html类型，页面编码是gb2312，也可以简写为&lt;meta charset=&quot;gb2312&quot;&gt;，语言控制：&lt;meta http-equiv=&quot;Content-Language&quot; content=&quot;zh-cn&quot; /&gt; ，说明该页面是简体中文</p>
</p>
<p>2、refresh 自动刷新并且指向新页面      </p>
<p>&lt;meta http-equiv=″refresh″ content=″2; URL=http://blog.chacuo.net″&gt;，2秒后，页面自动进入<a href="http://blog.chacuo.net">http://blog.chacuo.net</a></p>
</p>
<p>3、Expires（过期控制）      </p>
<p>&lt;meta http-equiv=&quot;expires&quot; content=&quot;Fri,12 Jan 2001 18:18:18 GMT&quot;&gt;，可以用于设定网页的到期时间。一旦网页过期，本地缓存将失效，必须重新从服务器读取信息！</p>
</p>
<p>4、Pragma(控制缓存模式） </p>
<p>禁止浏览器从本地计算机的缓存中访问页面内容，&lt;meta http-equiv=&quot;Pragma&quot; content=&quot;no-cache&quot;&gt; 。本地浏览器不保存内容！禁止缓存可以加上：&lt;meta http-equiv=&quot;Cache-Control&quot; CONTENT=&quot;no-cache&quot;&gt; ，这样一起控制！</p>
</p>
<p>5、set-cookie（设置cookie值）      </p>
<p>用法：&lt;meta http-equiv=&quot;Set-Cookie&quot; content=&quot;kkk=ddd; expires=Thu, 11-Jul-23 11:32:15 GMT; path=/; &quot;&gt; 设置cookie，名称是kkk，值为ddd,过期是2023-7-11 19:32:15秒！      </p>
</p>
</blockquote>
<p> <strong>帮助主页被各大搜索引擎登录、其它</strong><br />
<blockquote>
<p>1、Keywords 描述页面关键词      </p>
<p>&lt;meta name=&quot;keywords&quot; content=&quot;政治，经济，科技，文化，卫生，情感，心灵，娱乐，生活，社会，企业，交通&quot;&gt; ，便于搜索引擎，快速定位页面主题！</p>
</p>
<p>2、Description页面简介描述信息      </p>
<p>&lt;meta name=&quot;description&quot; content=&quot;程默博客是一个关注web安全、性能、框架，以及服务器性能、服务器架构、服务器安全,是一个值得Web开发朋友收藏的博客。&quot;/&gt; ，对页面简单描述概括！</p>
</p>
<p>3、Author页面所有者      </p>
<p>&lt;META name=&quot;author&quot; content=&quot;chengmo&quot;&gt; 该页面作者是：<a href="http://blog.chacuo.net/" target="_blank">chengmo</a></p>
</p>
<p>4、Copyright 版权说明      </p>
<p>&lt;META name=&quot;copyright&quot; content=&quot;&amp;copy; 2013 chacuo.net&quot;&gt; 版权信息描述！</p>
</p>
<p>5、Date 开创时间      </p>
<p>&lt;META name=&quot;date&quot; content=”2013-7-11T19:49:37+00:00”&gt;页面开创时间！</p>
</p>
<p>6、robots（机器人向导）      </p>
<p>说明：robots用来告诉搜索机器人哪些页面需要索引，哪些页面不需要索引。content的参数有all,none,index,noindex,follow,nofollow。默认是all。举例：&lt;meta name=&quot;robots&quot; content=&quot;none&quot;&gt;不索引该页，并且该页里面所有连接也不搜索索引！</p>
<p> 
</p>
</blockquote>
<p>以上是meta常见应用，可以对页面进行信息描述，也可以对搜索引擎进行引导！特别是它的属性及值，没有进一步的定义。随着不断应用，可能在后面我们还会扩展出新的属性，以及它对应值！它为今后的扩展预留很多的空间！也有些浏览器，还支持：进入、退出动画，窗口定义，分级定义。不过它不能很好在所有浏览器中兼容，一次没有一一列举！欢迎交流！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chacuo.net/332.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
