Quote:
Originally Posted by Jellby
As far as I understood, the OP wants the anchors to be "invisible"
|
Right, similar to normal text. An “a” element with no “href” attribute is not expected to affect rendering at all; and the problem here is that it does, on some e-book readers.
Quote:
and the problem is even with "color:inherit" iBooks adds some color to <a> elements.
|
Yes, probably because in iBooks, CSS support does not cover “inherit”.
Quote:
The suggested solution is using <span> instead of <a>, which would not produce any default formatting, and I don't see any drawback other than the loss of semantics.
|
The only drawback that I can imagine is how to deal with existing e-books that have index markers as “a” elements. If an author’s CSS code styles them somehow, the styling might thus get lost. But I think this is a small risk.
Semantically, an “a” element without “href” is just as empty as “span”. It has no meaning beyond the meanings of its attributes, i.e. it is just a text-level carrier of attributes. And according to HTML5 CR, which is virtually the de facto HTML standard, more or less, “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, consisting of just the element's contents.” So it’s OK to use such an element in a navigation menu, for the item that would be a link to the current page, and is such a link on other pages. But the use of “a” without “href” just to mark a destination for links hardly fits into the definition.