:target pseudo selector tutorial

There’s a good article online at Vitamin, Stay On :Target, about the CSS3 :target pseudo selector, which provides a good explanation and some working examples. :target is supported by all current browsers, except - well, I don’t need to say it, do I? - so you can start using it straight away.

  • Digg
  • del.icio.us
  • Facebook
  • Print this article!
  • StumbleUpon
  • TwitThis
  • E-mail this story to a friend!
February 1st, 2008 by Peter Gasston in Tutorials. You can leave a response, or trackback from your own site.

7 Comments to “:target pseudo selector tutorial”

  1. Stifu Says:

    Very interesting read, thanks.
    I’m thinking of implementing this into my site (for tabs, as mentioned in the article), with a Javascript fallback for IE.

  2. Luke Says:

    Actually, I’m noticing that none of the examples on that page work in Opera, and he notes in a few places that several of his examples only work in Firefox.

  3. Peter Gasston Says:

    @Luke: I’ve tested in Opera 9.5 (Beta) and they all seem to work; can’t swear to whether it works in O9 or below.

  4. Lars Says:

    Opera has support for :target in 9.5, but not in any earlier versions.

  5. Trn Says:

    Doesn’t work in Opera 9.24 here.

    Personally I prefer to use it with :not(), like here
    http://www.w3.org/Style/Examples/007/target

  6. webeame.net Says:

    Tutorial sobre el pseudo selector de CSS3 :target…

    css3.info enlaza un tutorial acerca del pseudoselector :target con ejemplos de utilización….

  7. jive Says:

    CSS based tabs with not JS? Awesome.

    The more and more advanced CSS gets it seems the more it replaces simple Javascript effects. :)

Leave a Comment