<?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; link</title>
	<atom:link href="http://blog.chacuo.net/tag/link/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>HTML Link标签 文档资源、导航、SEO 介绍</title>
		<link>http://blog.chacuo.net/339.html</link>
		<comments>http://blog.chacuo.net/339.html#comments</comments>
		<pubDate>Mon, 15 Jul 2013 08:12:59 +0000</pubDate>
		<dc:creator>程默</dc:creator>
				<category><![CDATA[web原理]]></category>
		<category><![CDATA[html标签]]></category>
		<category><![CDATA[link]]></category>

		<guid isPermaLink="false">http://blog.chacuo.net/?p=339</guid>
		<description><![CDATA[定义和用法 head头标签里面，有另一个不起眼的标签。那就是：Link标签。&#60;link&#62; 标签的作 [...]]]></description>
				<content:encoded><![CDATA[<p><strong>定义和用法</strong></p>
<p>head头标签里面，有另一个不起眼的标签。那就是：Link标签。&lt;link&gt; 标签的作用是定义文档与外部资源的关系，最常用的是链接样式表。</p>
<blockquote><pre></pre>
<p></p>
<pre>&lt;head&gt;
<code>&lt;link rel="stylesheet" type="text/css" href="header.css" /&gt;</code>
&lt;/head&gt;</pre>
</blockquote>
<pre>以上是链接样式表，这是常用的方法。其实它还可以做文件导航、以及seo方面都可以有用途。我们继续往下吧！</pre>
</p>
<p><strong>Link属性介绍</strong></p>
<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>rel</td>
<td>alternate<br />appendix<br />bookmark<br />chapter<br />contents<br />copyright<br />glossary<br />help<br />home<br />index<br />next<br />prev<br />section<br />start<br />stylesheet<br />subsection<br />icon (后来补充)</td>
<td>定义当前文档与被链接文档之间的关系</td>
</tr>
<tr valign="top">
<td>rev</td>
<td>alternate<br />appendix<br />bookmark<br />chapter<br />contents<br />copyright<br />glossary<br />help<br />home<br />index<br />next<br />prev<br />section<br />start<br />stylesheet<br />subsection</td>
<td>定义被链接文档与当前文档之间的关系</td>
</tr>
<tr valign="top">
<td>href</td>
<td>URL地址</td>
<td>定义被链接文档的位置</td>
</tr>
<tr valign="top">
<td>type</td>
<td>定义媒体类型 MIME_TYPE</td>
<td>指定被链接文档的 MIME 类型</td>
</tr>
<tr valign="top">
<td>media</td>
<td>screen<br />tty<br />tv<br />projection<br />handheld<br />print<br />braille<br />aural<br />all</td>
<td>规定被链接文档将显示在什么设备上</td>
</tr>
<tr valign="top">
<td>charset</td>
<td>字符编码如：utf-8,gb213等</td>
<td>指定被链接文档的字符编码方式</td>
</tr>
<tr valign="top">
<td>hreflang</td>
<td>语言2字代码 <i>language_code</i></td>
<td>指定被链接文档中文本的语言</td>
</tr>
</tbody>
</table>
</blockquote>
<p><strong>其它标准属性：</strong></p>
<blockquote>
<p>1、核心属性 (id,class,style,title)&nbsp; 分别是id号，样式名称，单行样式，title描述</p>
<p>2、语言属性(dir,lang,xml:lang)&nbsp; 分别是 文本方向、语言</p>
<p>3、键盘属性(accesskey,tabindex) 分别是 快捷键、tab建索引</p>
<p>以上属性也具有!</p>
</blockquote>
<p>&nbsp;</p>
<p><strong>SEO相关的使用属性</strong></p>
<p>1、canonical属性值</p>
<p>当一个站点，有几个内容一致的页面（相同内容，有多个url地址），这样页面多的出现、会因为大量重复内容出现，被搜索引擎降权！因此，我们可以利用该属性指定页面出处！</p>
<p>如：http://blog.chacuo.net/332.html&nbsp;&nbsp;&nbsp; http://blog.chacuo.net/?p=332</p>
<p>两个是同一个内容，那么我在http://blog.chacuo.net/?p=332 加入：&lt;link rel=&#8217;canonical&#8217; href=&#8217;http://blog.chacuo.net/332.html&#8217; /&gt;<br />告诉，搜索引擎，这个页面与322.html一致，以322.html为准，不要收录p=322页面。</p>
<p>2、next,prev,home等属性值，带连接的导航作用</p>
<p>例如：当前页是332.html，里面有：</p>
<p>&lt;link rel=&#8217;prev&#8217;&nbsp;&nbsp; href=&#8217;http://blog.chacuo.net/331.html&#8217; /&gt;&nbsp; &lt;link rel=&#8217;next&#8217;&nbsp;&nbsp; href=&#8217;http://blog.chacuo.net/333.html&#8217; /&gt;它相关的上一个页面是331.html，下一个页面是333.html。不过，目前搜索引擎对这些支持不是很好！基本作用不大！</p>
<p><strong>小结：</strong></p>
<p>link，rel属性有多种，现在也有新的扩展，例如wordpress中，我们可以看到：EditURI,wlwmanifest属性。我们也可以自己定义新的属性，不过已经确定了名称属性。它的作用已经固定，我们得遵守它的本意！</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chacuo.net/339.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
