Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Should we be using (HTML5) rel attributes within site navigation

Simply straightforward question, but one for which I cannot find any suggestions.

Supported HTML5 values that are appropriate are:

  • author
  • first
  • last
  • next
  • prev
  • help
  • license (not "licence")

Example

Navigation consisting of index, about, contact & legal

..from the perspective of the index.html page:

  • index.html with rel="first"
  • about.html with rel=author next"
  • contact.html with rel="help"
  • legal.html with rel="license last"

...from the perspective of the contact.html page:

  • index.html with rel="first"
  • about.html with rel=author prev"
  • contact.html with rel="help"
  • legal.html with rel="license next last"

I accept that the use of rel in navigation will achieve very little; but it might help Search Engines in some small way.

I gave the examples both as a demonstration of how this would work in practise and for critique!

Kind Regards, Dale

Edits to examples from comments below

Navigation consisting of index, about, contact & legal

..from the perspective of the index.html page:

  • index.html with no rel
  • about.html with rel=author"
  • contact.html with rel="help"
  • legal.html with rel="license"

...from the perspective of the contact.html page:

  • index.html with no rel
  • about.html with rel=author"
  • contact.html with rel="help"
  • legal.html with rel="license"
like image 344
Dale Rollinson Avatar asked Apr 22 '12 18:04

Dale Rollinson


People also ask

Why REL attribute is used?

The rel attribute specifies the relationship between the current document and the linked document. Only used if the href attribute is present. Tip: Search engines can use this attribute to get more information about a link!

What is the use of link rel in HTML?

The HTML rel attribute is used to specify the relationship between the current and the linked document. It is used only when href attribute present. alternate: It specifies the alternative link of the document(i.e. print page, translated or mirror).

What is rel attribute in SEO?

Rel attributes are little bits of html text that detail the relationship between the page a link is on and the page or document it is pointing to. Rel attributes can be used for links and also other elements of html like site navigation or forms.

What does rel mean in CSS?

The REL attribute is used to define the relationship between the linked file and the HTML document. REL=StyleSheet specifies a persistent or preferred style while REL="Alternate StyleSheet" defines an alternate style. A persistent style is one that is always applied when style sheets are enabled.


2 Answers

Good Question ! To be honest i'm no expert with the rel attribute (so someone correct me if i'm wrong) but from what i can find Google can verify an identity on a web page via the attribute. Such as

<a rel="me" href="https://plus.google.com/110037486217106671520">Luke Southam</a>

i know this is off the subject of site navigation but it shows Google is reading and indexing the attribute within the <a></a> tag. As for using it within site navigation, if it (possibly) helps Google (or other search engines) to index your website better I say go for it.

like image 164
luke Avatar answered Sep 19 '22 12:09

luke


Yes, you may use rel for links in the navigation. Because …

… you may use rel for every link.

With an appropriate link type, that is. You may only use a specific set of defined and registered rel values in HTML5.


first & last, next & prev

first and last are no longer defined in the HTML5 spec. In the Microformats wiki page existing rel values they are listed as synonyms for begin and end, which are defined as:

identifies the author-defined start[/end] of a sequence of documents of which the current document is a node.

So they are not suitable for a typical website navigation. Use them when linked documents should be read in a specific order.

next and prev are defined in the HTML5 spec as:

[…] indicates that the document is part of a sequence […]

Same argument as above for first/last: only use it if there is a specific order (which is not the case for a navigation consisting of "About", "Contact", "Legal", …). Most prominent use would be for pagination.

author

The author link type

indicates that the referenced document provides further information about the author of the nearest article element ancestor of the element defining the hyperlink, if there is one, or of the page as a whole, otherwise.

You just have to make sure that your navigation (resp. this author link) is not a child of an article element (which would be very uncommon for a site navigation).

help

The help link type is defined as:

For a and area elements, the help keyword indicates that the referenced document provides further help information for the parent of the element defining the hyperlink, and its children.

So this doesn’t seem to be appropriate (even if the Contact page would provide "further help information", because it would be technically the help for the navigation itself (→ the parent element of the link), not for the whole page (which is only the case if used in a link element in the head, or if the help link is a direct child of the body.)

license

The license link type

[…] indicates that the referenced document provides the copyright license terms under which the main content of the current document is provided.

Seems to be appropriate (if your Legal page contains those terms).

like image 39
unor Avatar answered Sep 19 '22 12:09

unor