| Version |
|---|
| CSS3 |
| IE8 | FF1+ | SA3.1+ | OP9.5+ | CH2+ |
|---|---|---|---|---|
| None | Full | Full | Full | Full |
Syntax
Description
This pseudo-class matches an
element that’s the target of a fragment identifier in the document’s URI.
The fragment identifier in a URI comprises a #
character followed by an identifier name that matches the value of an
id attribute of an element within the
document.
Example
For example, if the URI was
http://www.example.com/index.html#section2, the following
selector would match the element that had an id
attribute of "section2":
:target {
⋮ declarations
}
Compatibility
| Internet Explorer | Firefox | Safari | Opera | Chrome | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 5.5 | 6.0 | 7.0 | 8.0 | 1.0 | 1.5 | 2.0 | 3.0 | 3.5 | 1.3 | 2.0 | 3.1 | 4.0 | 9.2 | 9.5 | 10.0 | 2.0 |
| None | None | None | None | Full | Full | Full | Full | Full | Buggy | Buggy | Full | Full | None | Full | Full | Full |
In Safari versions up to and including 3, this rule isn’t applied when the user navigates using the back and forward buttons.
User-contributed notes
- ID:
- #3
- Date:
- Tue, 03 May 2011 18:34:49 GMT
- Status:
- This note has not yet been confirmed for accuracy and relevance.
ie9 support
- ID:
- #2
- Date:
- Fri, 19 Feb 2010 23:58:12 GMT
Opera (up-to an including current versions) do not apply the rule when navigating the back and forward buttons.
- ID:
- #1
- Date:
- Thu, 16 Jul 2009 08:41:39 GMT
IE8 is still not supporting the pseudo-class.
Add a note
To post a note on this topic, please log in with your SitePoint username and password. If you don't have an account yet, you can create a new account for free.