6.5. Document Relationships
There are a host of other attributes that you can add to your anchor tags to describe the form of the target being linked to, the relationship between the current document and the target, and more.
The following table lists these descriptive attributes and their possible values.
6.5.1.
6.5.1.1. Link Target Details
Attribute | Meaning | Value(s) |
---|---|---|
charset | The character encoding of the target | char_encoding for example, "ISO 8859-1" |
hreflang | The base language of the target | language_code for example, "en-US" |
rel | The relationship between the current document and the target | alternate
designates stylesheet start next prev contents index glossary copyright chapter section subsection appendix help bookmark |
rev | The relationship between the target and the current document | alternate
designates stylesheet start next prev contents index glossary copyright chapter section subsection appendix help bookmark |
type | The MIME type of the target | Any valid MIME type |
An example of how the relationship attributes (rel, rev) can be used is shown in the following code snippet:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <title>Chapter 10</title> </head> <body> <p><a href="contents.html" rel="chapter" rev="contents">Table of Contents</a></p> <p><a href="chapter 9.html" rel="next" rev="prev">Chapter 9</a></p> <p><a href="chapter 11.html" rel="prev" rev="next">Chapter 11</a></p> ...
The anchor tags define the relationships ...
Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.