rel property (a, link)
Specifies or returns the relationship between the current document and the destination of an anchor or link.
This property contains information for the author only, there isn't any functionality assigned to this property.
Syntax:
You can find the related objects in the Supported by objects section below.
This property is read/write.
HTML page for this property: rel |
Possible values:
String that sets or retrieves a space-separated list of relation types.
The list of the supported relation types:
Designates substitute versions for the document in which the link occurs. | |||||||
Page that is an appendix for the set of pages. | |||||||
Bookmark. | |||||||
Refers to a document serving as a chapter in a collection of documents. | |||||||
Refers to a document serving as a table of contents. | |||||||
Copyright notice. | |||||||
Glossary for the page. | |||||||
Help document. | |||||||
Refers to a document providing an index for the current document. | |||||||
Refers to the next document in a sequence. | |||||||
Instruct search engines that the current document has no effect on the page ranking of the linked document. | |||||||
Location that contains a path to the CDF file. | |||||||
Refers to the previous document in a sequence. | |||||||
Referes to an XML file in OpenSearch description format. | |||||||
Page that is a section for a set of pages. | |||||||
Refers to an icon location. | |||||||
Refers to the bookmarks panel. Only works with Opera and Firefox. | |||||||
Refers to the first document. | |||||||
Refers to an external style sheet. | |||||||
Page that is a subsection for a set of pages. |
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the rel attribute:
|
|||||
<head> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> Some text content </body> |
|||||
|
|||||
Did you find this example helpful?
|
Example HTML code 2:
This example shows how to tell the client's browser that you offer a search plugin from HTML. If the search provider is currently installed it will be selected search engine. Note that the AddSearchProvider method provides similar functionality in JavaScript.
|
|||||
<head> <link rel="search" type="application/opensearchdescription+xml" href="searchProvider.xml" title="Dottoro Search" /> </head> <body> Please open the drop-down menu of your browser's Search Box. </body> |
|||||
|
|||||
Did you find this example helpful?
|
Example HTML code 3:
This example illustrates the use of the rel property:
|
|||||
<head> <link id="baseStyles" rel="stylesheet" type="text/css" href="style.css" /> <script type="text/javascript"> function GetRelationType () { var link = document.getElementById ("baseStyles"); alert (link.rel); } </script> </head> <body> Some text content <button onclick="GetRelationType ();">Get relation!</button> </body> |
|||||
|
|||||
Did you find this example helpful?
|
Supported by objects:
Related pages:
External links:
User Contributed Comments