zoukankan      html  css  js  c++  java
  • 【131031】rel 属性 -- link标签中的rel属性,定义了文档与链接的关系

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

        示例

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

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

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

        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"

        示例

        rel="stylesheet" type="text/css" href="style.css" /> 
      • Start -- 通知搜索引擎,文档的开始
        start next prev 属性值 -- start next prev,全部属于LinkTypes,此值通常可以提示浏览器文章的开始,下一篇,上一篇的url
        • 此属性值通常在,rel,rev属性中出现

        示例

        rel="start" type="text/html" href="http://www.dreamdu.com/xhtml/" /> rel="prev" type="text/html" href="http://www.dreamdu.com/xhtml/alternate/" /> rel="next" type="text/html" href="http://www.dreamdu.com/xhtml/attribute_rel/" />
      • next -- 记录文档的下一页.(浏览器可以提前加载此页)
        start next prev 属性值 -- start next prev,全部属于LinkTypes,此值通常可以提示浏览器文章的开始,下一篇,上一篇的url
        • 此属性值通常在,rel,rev属性中出现

        示例

        rel="start" type="text/html" href="http://www.dreamdu.com/xhtml/" /> rel="prev" type="text/html" href="http://www.dreamdu.com/xhtml/alternate/" /> rel="next" type="text/html" href="http://www.dreamdu.com/xhtml/attribute_rel/" />
      • Prev -- 记录文档的上一页.(定义浏览器的后退键)
        start next prev 属性值 -- start next prev,全部属于LinkTypes,此值通常可以提示浏览器文章的开始,下一篇,上一篇的url
        • 此属性值通常在,rel,rev属性中出现

        示例

        rel="start" type="text/html" href="http://www.dreamdu.com/xhtml/" /> rel="prev" type="text/html" href="http://www.dreamdu.com/xhtml/alternate/" /> 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属性.

  • 相关阅读:
    linux 学习随笔-shell基础知识
    linux 学习随笔-压缩和解压缩
    解析xml的4种方法详解
    集合工具类
    Map概述
    List集合概述
    Java集合框架
    Spring JdbcTemplate详解
    关于c3p0数据库连接池的简单使用
    Java通过JDBC封装通用DAO层
  • 原文地址:https://www.cnblogs.com/husam/p/3684008.html
Copyright © 2011-2022 走看看