liqingyi's blog

快乐无求

导航

« jstl中的varStatus的详解IE6,IE7,FF等浏览器不兼容原因及解决办法 »

HTML link的rel 属性

rel 属性 -- link标签中的rel属性,定义了文档与链接的关系.
  • 此属性通常出现在a,link标签中
  • 属性值

    • Alternate -- 定义交替出现的链接

    • Alternate 属性值 -- alternate是LinkTypes的一个值,网页设计者可以通过此值,设计交替出现的链接
      • 此属性值通常在,rel,rev属性中出现

      示例

      定义两种不同的样式,用户可以通过浏览器选择样式(ie不支持此属性)

      <link rel="stylesheet" type="text/css" title="blue" href="dreamdublue.css" />
      <link rel="alternate stylesheet" type="text/css" title="red" href="dreamdured.css" />

      可以通过http://www.dreamdu.com/feed/读取http://www.dreamdu.com/的内容

      <link rel="alternate" type="application/rss+xml" href="http://www.dreamdu.com/feed/" />

    • Stylesheet -- 定义一个外部加载的样式表

    • link 标签 -- 当在文档中声明使用外接资源(比如CSS)时使用此标签
      • link标签是单独出现的
      • 属性
        • href -- 指定需要加载的资源(CSS文件)的地址URI
        • media -- 媒体类型,参见CSS教程
        • rel -- 指定链接类型
        • rev -- 指定链接类型
        • type -- 包含内容的类型,一般使用type="text/css"

      示例

      <head>
      <link rel="stylesheet" type="text/css" href="style.css" />
      </head>

    • Start -- 通知搜索引擎,文档的开始

    • start next prev 属性值 -- start next prev,全部属于LinkTypes,此值通常可以提示浏览器文章的开始,下一篇,上一篇的url
      • 此属性值通常在,rel,rev属性中出现

      示例

      <link rel="start" type="text/html" href="http://www.dreamdu.com/xhtml/" />
      <link rel="prev" type="text/html" href="http://www.dreamdu.com/xhtml/alternate/" />
      <link rel="next" type="text/html" href="http://www.dreamdu.com/xhtml/attribute_rel/" />

    • next -- 记录文档的下一页.(浏览器可以提前加载此页)

    • start next prev 属性值 -- start next prev,全部属于LinkTypes,此值通常可以提示浏览器文章的开始,下一篇,上一篇的url
      • 此属性值通常在,rel,rev属性中出现

      示例

      <link rel="start" type="text/html" href="http://www.dreamdu.com/xhtml/" />
      <link rel="prev" type="text/html" href="http://www.dreamdu.com/xhtml/alternate/" />
      <link rel="next" type="text/html" href="http://www.dreamdu.com/xhtml/attribute_rel/" />

    • Prev -- 记录文档的上一页.(定义浏览器的后退键)

    • start next prev 属性值 -- start next prev,全部属于LinkTypes,此值通常可以提示浏览器文章的开始,下一篇,上一篇的url
      • 此属性值通常在,rel,rev属性中出现

      示例

      <link rel="start" type="text/html" href="http://www.dreamdu.com/xhtml/" />
      <link rel="prev" type="text/html" href="http://www.dreamdu.com/xhtml/alternate/" />
      <link rel="next" type="text/html" href="http://www.dreamdu.com/xhtml/attribute_rel/" />
    • Contents
    • Index -- 当前文档的索引
    • Glossary -- 词汇
    • Copyright -- 当前文档的版权
    • Chapter -- 当前文档的章节
    • Section -- 作为文档的一部分
    • Subsection -- 作为文档的一小部分
    • Appendix -- 定义文档的附加信息
    • Help -- 链接帮助信息
    • Bookmark -- 书签

rel与rev属性相同,它们都是属于LinkTypes属性.

 

 

ZF HEADLINK相关的HTML link标签 rel 属性

rel 属性 -- rel属性,描述了当前页面与href所指定文档的关系.

  • rel属性通常出现在a,link标签中
  • 属性值
    • alternate -- 定义交替出现的链接
    • appendix -- 定义文档的附加信息
    • bookmark -- 书签
    • chapter -- 当前文档的章节
    • contents
    • copyright -- 当前文档的版权
    • glossary -- 词汇
    • help -- 链接帮助信息
    • index -- 当前文档的索引
    • next -- 记录文档的下一页.(浏览器可以提前加载此页)
    • nofollow -- 不被用于计算PageRank
    • prev -- 记录文档的上一页.(定义浏览器的后退键)
    • section -- 作为文档的一部分
    • start -- 通知搜索引擎,文档的开始
    • stylesheet -- 定义一个外部加载的样式表
    • subsection -- 作为文档的一小部分
  • rel是relationship的英文缩写. "

 


o 定义两种不同的样式,用户可以通过浏览器选择样式(ie不支持此属性)

   示例

  <link rel="stylesheet" type="text/css" title="blue" href="blue.css" />
  <link rel="alternate stylesheet" type="text/css" title="red" href="red.css" />

 

   FF查看效果:查看-页面风格 。

 

 
o  点亮浏览器RSS订阅图标,如下出现两个选择 

 
  示例 

 <link href="/rss/my" rel="alternate" title="1.我参与的讨论、问答RSS" type="application/rss+xml" />
 <link href="/rss/my" rel="alternate" title="2.我参与的讨论、问答RSS" type="application/rss+xml" />

 

 

 

o Stylesheet -- 定义一个外部加载的样式表

  示例

  <head>
  <link rel="stylesheet" type="text/css" href="style.css" />
  </head>

 

o Start -- 通知搜索引擎,文档的开始

  start next prev 属性值 -- start next prev,全部属于LinkTypes,

  此值通常可以提示浏览器文章的开始,下一篇,上一篇的url
   

  示例

  <link rel="start" type="text/html" href="http://www.xxx.com/xhtml/" />
  <link rel="prev" type="text/html" href="http://www.xx.com/xhtml/alternate/" />
  <link rel="next" type="text/html" href="http://www.xxx.com/xhtml/attribute_rel/" />

 

 列子W3C.ORG 的 head

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">
<head profile="http://www.w3.org/2000/08/w3c-synd/#"><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
  <meta name="keywords" content="W3C, World Wide Web, Web, WWW, Consortium, computer, access, accessibility, semantic, worldwide, W3, HTML, XML, standard, language, technology, link, CSS, RDF, XSL, Berners-Lee, Berners, Lee, style sheet, cascading, schema, XHTML, mobile, SVG, PNG, PICS, DOM, SMIL, MathML, markup, Amaya, Jigsaw, free, open source, software" />
  <meta name="description" content="The World Wide Web Consortium (W3C) is an international consortium where Member organizations, a full-time staff, and the public work together to develop Web standards. W3C primarily pursues its mission through the creation of Web standards and guidelines designed to ensure long-term growth for the Web. Over 400 organizations are Members of the Consortium. W3C is jointly run by the MIT Computer Science and Artificial Intelligence Laboratory (MIT CSAIL) in the USA, the European Research Consortium for Informatics and Mathematics (ERCIM) headquartered in France, Keio University in Japan, and has additional Offices worldwide." />
  <title>World Wide Web Consortium - Web Standards</title>


  <link rel="meta" href="/Overview-about.rdf" />


  <link rel="stylesheet" type="text/css" href="/StyleSheets/home.css" />


  <link rel="bookmark" href="#technologies" title="Technologies |" />
  <link rel="bookmark" href="#news" title="News |" />
  <link rel="bookmark" href="#search" title="Search |" />
  <link rel="contents" href="#contents" title="Contents |" />
  <link rel="bookmark" href="#Offices" title="Offices |" />
  <link rel="bookmark" href="#systems" title="Systems |" />
  <link rel="bookmark" href="#donors" title="Supporters |" />
  <link rel="bookmark" href="#footnotes" title="Footnotes |" />


  <link rel="alternate" type="application/rss+xml" title="W3C Home Page News RSS Channel" href="http://www.w3.org/2000/08/w3c-synd/home.rss" />
 
  <style type="text/css">
/**/
   div.spot-image img {
      margin-bottom: 20px;
   }
/**/</style>
</head>

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

Powered By Z-Blog 1.7 Laputa Build 70216

Copyright 2006-2008 www.imeimei.com Some Rights Reserved. 冀ICP备06035462号
声明:本博客无任何商业目的,所发表文章只为学习与交流为目的