Take Five! – The rel attribute

Within the main <nav> container – and in one case within the <leeloo> element – Take Five! is responsive to the rel attributes given to links. These generate labels and navigation buttons according to the following table:

rel attribute Declared as Label Button
"index" article.slide > nav:first-of-type a[rel~="index"] “Index”
"first" article.slide > nav:first-of-type a[rel~="first"] “First slide”
"next" article.slide > nav:first-of-type a[rel~="next"] “Next slide”
"prev" article.slide > nav:first-of-type a[rel~="prev"] “Previous slide”
"last" article.slide > nav:first-of-type a[rel~="last"] “Last slide”
"attachment" article.slide > nav:first-of-type a[rel~="attachment"] “Download” 📎
"bookmark" article.slide > nav:first-of-type a[rel~="bookmark"] “Share it!” 🔗
"author" article.slide > nav:first-of-type a[rel~="author"] “Author” ✉️
"discussion" article.slide > nav:first-of-type a[rel~="discussion"] “Comments” 🗨
"parent" article.slide > nav:first-of-type a[rel~="parent"] “Back to” when not empty or “Click to exit” when empty ×
"child" article.slide > nav:first-of-type a[rel~="child"] “More” None
"tag" article.slide > nav:first-of-type a[rel~="tag"] “Tagged content” None
article.slide a[rel~="tag"] “★”

Notes

Further considerations

The a[rel~="parent"] element

In order to exit from the viewport the a[rel~="parent"] element is used (see above). Normally this links to any unexisting hash (in our examples we used the "#nowhere" hash link, although a simple "#" can be enough), but in the case of nested galleries it can optionally link to the parent gallery.

The special link a[rel~="parent"] complies with the following rule:

More than one token in the rel attribute

It is syntactically and semantically valid to assign more than one token to the rel attribute. As explained in the W3C Recommendation 28 October 2014,

The attribute's value must be a set of space-separated tokens.

In this case, within the main <nav>, the CSS will choose the most significant token according to the following order (the more down in the list the less significant):

  1. "parent"
  2. "child"
  3. "next"
  4. "prev"
  5. "first"
  6. "last"
  7. "index"
  8. "attachment"
  9. "bookmark"
  10. "author"
  11. "discussion"
  12. "tag"

For instance, <a href="#hello-world" rel="index prev">Hello world</a> will be styled as if it contained just the token "prev", while <a href="#hello-world" rel="prev parent">Hello world</a> will be styled as if it contained just the token "parent", and so on. The "child" token used together with one of the tokens 3-11 listed above will preserve the button generated by the latter.

Possible values for the rel attribute are several (it can be worth to have a look at the HTML Living Standard and the IANA link relation registry), and you are free to use the keywords that best suit your needs. Furthermore:

Extensions to the predefined set of link types may be registered in the microformats wiki existing-rel-values page.