W3C home > Mailing lists > Public > public-vocabs@w3.org > February 2012

Re: Breadcrumbs: Last Item Not Hyperlinked

From: Gunnar Bittersmann <gunnar@bittersmann.de>
Date: Fri, 10 Feb 2012 15:48:58 +0100
Message-ID: <4F352E5A.3050707@bittersmann.de>
To: public-vocabs@w3.org
Irfanullah Jan scripsit:
> However, I want to remove the <a> element from the last item, because I
> think it is unnecessary to link to current page.

You might keep the <a> element, just remove its @href attribute. The 
HTML5 spec says, “If the a element has no href attribute, then the 
element represents a placeholder for where a link might otherwise have 
been placed, if it had been relevant.” 
[http://www.w3.org/TR/html5-author/the-a-element.html#the-a-element]


>     <a href="category/books-literature.html">Literature & Fiction</a> >

You’d better escape the ampersand. Your mark-up might look like

<div itemprop="breadcrumb">
   <a href="category/books.html">Books</a> >
   <a href="category/books-literature.html">Literature &amp; Fiction</a> >
   <a>Classics</a>
</div>

or as a list

<ol itemprop="breadcrumb">
   <li><a href="category/books.html">Books</a></li>
   <li><a href="category/books-literature.html">Literature & 
Fiction</a></li>
   <li><a>Classics</a></li>
</ol>

with style

[itemprop="breadcrumb"] li:not(:last-child)::after { content: ' >' }

Cheers,
Gunnar
Received on Friday, 10 February 2012 14:49:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 06:48:59 GMT