DIV CSS 佈局教程網

 DIV+CSS佈局教程網 >> 網頁腳本 >> CSS入門知識 >> CSS詳解 >> Link 標簽 rel=Stylesheet的實際作用
Link 標簽 rel=Stylesheet的實際作用
編輯:CSS詳解     
關於Link標簽,相信接觸的人都知道相關用法,但是我經常忘記rel的實際作用,這次專門查找了下,記錄,以作備用。

Link標簽有兩個作用:1. 定義文檔與外部資源的關系;2. 是鏈接樣式表。

下面是鏈接外部樣式表

復制代碼代碼如下:
<head>
<link rel="stylesheet" type="text/css" href="theme.CSS" />
</head>

href 為 URL地址;

type為鏈接文件的格式;

rel 該屬性規定當前文檔與被鏈接文檔之間的關系。但是,只有 rel 屬性的 "stylesheet" 值得到了所有浏覽器的支持。其他值只得到了部分地支持。
值 描述 alternate 文檔的替代版本(比如打印頁、翻譯或鏡像)。 stylesheet 文檔的外部樣式表。 start 集合中的第一個文檔。 next 集合中的下一個文檔。 prev 集合中的上一個文檔。 contents 文檔的目錄。 index 文檔的索引。 glossary 在文檔中使用的詞匯的術語表(解釋)。 copyright 包含版權信息的文檔。 chapter 文檔的章。 section 文檔的節。 subsection 文檔的小節。 appendix 文檔的附錄。 help 幫助文檔。 bookmark 相關文檔。
link標簽是用於當前文檔引用外部文檔的,其次,這個標簽的rel屬性用於設置對象和鏈接目的間的關系,說白了就是指明你鏈進來的對象是個什麼東西的,具體的值及其所表示的關系如下:

Alternate:Substitute version of the file that contains the link.
Appendix:Page that is an appendix for the set of pages.
Bookmark:Bookmark.
Chapter:Page that is a chapter for a set of pages.
Contents:Table of contents document.
Copyright:Copyright notice for the current page.
Glossary:Glossary for the current page.
Help:Help document.
Index:Index document for the current page.
Next:Next document in a sequence.
Offline:href that contains a path to the CDF file to be used for an offline favorite.
Prev:Previous document in a sequence.
Section:Page that is a section for a set of pages.
Shortcut:Icon href that contains a path to an icon file to be used for the favorite or link.
Start:First document of a set.
Stylesheet:Style sheet.
Subsection:Page that is a subsection for a set of pages.
XML學習教程| jQuery入門知識| AJAX入門| Dreamweaver教程| Fireworks入門知識| SEO技巧| SEO優化集錦|
Copyright © DIV+CSS佈局教程網 All Rights Reserved