Tim’s
Bandwagon

CSS Target Trick

Spotted on Daniel Glazman’s weblog, a good use of using the CSS :target selector to highlight the active target (example). I knocked-up a simple demonstration.

5 Comments

  1. Thanks for the tip! I’m using this technique on my own site now. :)

  2. Nice example on Ben Hammersley’s weblog (uses this technique for highlighting footnotes).

  3. This is not cross-browser compatible though. Make it not very useful…

  4. Excellent! Works in FF2, Chrome, Opera, SeaMonkey and Safari.

    But it dees not work in IE7. Any work arounds for IE7?

  5. I believe you can “fix” IE7 using some javascript to make this technique work.

    Here’s a demo: http://ie7-js.googlecode.com/svn/test/target.html#bananas.

Leave a Comment

Your personal information

Your comment