
Practical HTML: Improving Link Semantics
- Transfer
Note: the translation of the article “Boost Your Hyperlink Power” is below . It highlights the use of the rel and rev attributes, as well as some microformats.
We use part of HTML tags and attributes every day in our work. Headings, paragraphs, lists and pictures are the basis of the markup of each web developer. But the most common element will probably be a link - a simple tag that links together all the pages, creating the very messy structure that we call the World Wide Web.
The full potential of links lies in attribute
The attribute
“So what,” you say. - “That's all I already know,” and you will be absolutely right! But the link has something else besides the attribute
Theory of Relativity (
Maybe you already read about the attribute
The attribute
Another common use
In this case, the relationship between the current document and the associated one, an RSS feed, is indicated as
Both of these examples use a tag
You can add additional information to this link using the attribute
There is no specific list of values for an attribute
Although you are completely free to use attribute values
This design describes that the current page refers to a document marked as “license”.
Microformat
In this case, the label “Microformats” has been added for this document.
XFN (XHTML Friends Network) is a way of describing relationships between people:
This microformat greatly expands the possible use of the attribute
Thus, I indicate that Drew is my friend, I met him and he is my colleague (after all, we are both fans of the Internet ( Web monkies )).
“We - want change” (
If it
The attribute
Microformat
There is a corresponding meaning
Naturally, nothing prevents using both
The ease of use
Many thanks to those who read the entire article. I would like to hear your opinion or comments about the use
Web Optimizator: checking the speed of loading sites
We use part of HTML tags and attributes every day in our work. Headings, paragraphs, lists and pictures are the basis of the markup of each web developer. But the most common element will probably be a link - a simple tag that links together all the pages, creating the very messy structure that we call the World Wide Web.
Link as it is
The full potential of links lies in attribute
href
, short for hypertext reference
. It creates a one-way link from the current page to another resource, usually another same page on the Internet:The attribute
href
is in the opening tag a
, between the opening and closing tags is the text to describe the link:Drew mclellan
“So what,” you say. - “That's all I already know,” and you will be absolutely right! But the link has something else besides the attribute
href
.Theory of Relativity ( rel
ativity)
Maybe you already read about the attribute
rel
at the link. I bet head
there's something like this in the section of your pages:The attribute
rel
describes the relationship between the current document and the one it points to. In this case, the attribute value rel
is stylesheet
. This means that the linked document is a style sheet for the current one: just such a relationship between them. Another common use
rel
:In this case, the relationship between the current document and the associated one, an RSS feed, is indicated as
alternate
: an alternative representation of the current document. Both of these examples use a tag
link
, but you can use the attribute rel
with regular links as well. For example, we link to your RSS feed from the section:Subscribe to my RSS feed .
You can add additional information to this link using the attribute
rel
:Subscribe to my RSS feed .
There is no specific list of values for an attribute
rel
, so you can use anything that you consider semantically reasonable. For example, if you have a complex commercial web application that has a link to a tooltip, you can determine the relationship between the current page and this tooltip using the value help
:need a hint?
Elementary microformats
Although you are completely free to use attribute values
rel
, there are already some generally accepted values when using microformats . Some of the simplest microformats offer smart use cases rel
. For example, if you refer to the license under which this document is published, use microformat rel-license
:Distributed under Creative Commons license.
This design describes that the current page refers to a document marked as “license”.
Microformat
rel-tag
goes a little further. It is used to indicate that the last part of the link’s URL is the “label” for the current document:Read about semantic layout
In this case, the label “Microformats” has been added for this document.
XFN (XHTML Friends Network) is a way of describing relationships between people:
Drew mclellan
This microformat greatly expands the possible use of the attribute
rel
. Just like an attribute class
, it rel
can take several values, separated by a space:Drew mclellan
Thus, I indicate that Drew is my friend, I met him and he is my colleague (after all, we are both fans of the Internet ( Web monkies )).
“We - want change” ( rev
olution)
If it
rel
describes the relationship between the current page and the one to which it refers ( note: the current page -> another page ) then it is rev
used for the inverse relationship: it determines the type of link between the page that is linked and the current ( note: the current page < - another page ). The following is an example that can be used in help.html:return to the store
The attribute
rev
indicates that the current page is a help page, a hint for the one to which it refers. Microformat
vote-links
allows you to use the attribute rev
to refine your links. For example, by defining a value vote-for
, you can indicate that your document supports the one it refers to:I agree with Richard Dawkins .
There is a corresponding meaning
vote-against
. It means that although you refer to this document, you explicitly indicate that you do not agree with it.I agree with Richard Dawkins
about creationists .
Naturally, nothing prevents using both
rel
, and rev
:Richard Dawkins
The rationality of the majority
The ease of use
rel
and rev
hiding rich potential. They make it relatively easy to add more semantic meaning to your links, which creates links that can then be processed by search robots, aggregators or browsers. Let your next step be a close acquaintance with these attributes and expanding the capabilities of links.Related Links
Many thanks to those who read the entire article. I would like to hear your opinion or comments about the use
rel/rev
, in particular, or microformats in general. Web Optimizator: checking the speed of loading sites