Comments on: Using CSS3 :target selectors The (mostly techie) ramblings of Peter Ryan. Tue, 26 May 2009 16:39:36 +0000 hourly 1 By: Abas com CSS utilizando :target » CSS no Lanche Mon, 04 May 2009 11:18:42 +0000 [...] verão que foi utilizado um arquivo JavaScript chamado: csstarget.js, um script desenvolvido por Peter Ryan que faz com que o seletor :target funcione em todos os browsers que não suportam esse seletor [...]

By: Peter Ryan Mon, 08 Sep 2008 21:07:43 +0000 Hi Paulp,

I’m not sure I understand your question, but the intent behind this code is that you can link _to_ a page with this code with a URL containing a fragment identifier and the appropriate :target CSS rule will be applied.

So if I link to the test page like so:

none of the :target rules will be applied on page load, but if I link using a fragment identifier:

then the :target rule is applied and [in this case] the heading “Part Two” is highlighted.

Hope that helps!


By: Paulp Mon, 08 Sep 2008 19:38:20 +0000 Is there any way to get this to work when clicking a link from another page ???