Comments on: Using CSS3 :target selectors https://blog.peter-ryan.co.uk/2008/03/14/using-css3-target-selectors/ The (mostly techie) ramblings of Peter Ryan. Tue, 26 May 2009 16:39:36 +0000 hourly 1 http://wordpress.org/?v=3.8.1 By: Abas com CSS utilizando :target » CSS no Lanche https://blog.peter-ryan.co.uk/2008/03/14/using-css3-target-selectors/comment-page-1/#comment-919 Mon, 04 May 2009 11:18:42 +0000 https://blog.peter-ryan.co.uk/2008/03/14/using-css3-target-selectors/#comment-919 [...] 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 https://blog.peter-ryan.co.uk/2008/03/14/using-css3-target-selectors/comment-page-1/#comment-426 Mon, 08 Sep 2008 21:07:43 +0000 https://blog.peter-ryan.co.uk/2008/03/14/using-css3-target-selectors/#comment-426 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:
http://peter-ryan.co.uk/static/20080314/example01.html

none of the :target rules will be applied on page load, but if I link using a fragment identifier:
http://peter-ryan.co.uk/static/20080314/example01.html#p2

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

Hope that helps!

Peter.

]]>
By: Paulp https://blog.peter-ryan.co.uk/2008/03/14/using-css3-target-selectors/comment-page-1/#comment-425 Mon, 08 Sep 2008 19:38:20 +0000 https://blog.peter-ryan.co.uk/2008/03/14/using-css3-target-selectors/#comment-425 Is there any way to get this to work when clicking a link from another page ???

]]>