- From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
- Date: Fri, 28 Oct 2005 23:44:07 +0200
- To: Andrew Fedoniouk <news@terrainformatica.com>
- Cc: www-style@w3.org
Andrew Fedoniouk wrote:
> ...I am looking on this definition:
> http://www.w3.org/TR/2000/WD-css3-selectors-20001005/#target-pseudo
>
> Am I correct in my assumption that :target matches all elements
> in current loaded document having either ID or name attributes equal to
> the target-id part of *the uri which was used for loading
> current document* ?
No, you're not.
1. it is illegal for an HTML document to have more than one element having the
same ID, that's SGML. Same thing for XHTML/XML.
2. the name attribute is a fragment identifier's target only on an anchor
element.
3. as per section 12.2 of HTML4, name and id attributes share the same
namespace (that's my very first contribution to the HTML 4 spec, during
an HTML WG face-to-face meeting in Sophia-Antipolis too many years ago)
and must be unique, together, in the scope of the document.
Furthermore, browsers do not - because they cannot - target all elements
matching URL's fragment identifier. In case of an invalid document having
more than once the same ID or name attribute on an anchor, browsers target
the first one found in traversal order of the document.
</Daniel>
Received on Friday, 28 October 2005 21:44:24 UTC