SitePoint
Reference
CSS
Selector Reference
Pseudo-classes
CSS3 Pseudo-classes
:target
CSS Live Demo: :target
(this page)
See also:
All Live Demos
CSS Live Demo: :target
Type your
CSS
here:
(any properties allowed except expression, behavior and @import)
:target { background:#ff0; } p { background:#ccc; }
Type your
HTML
here:
(any tags allowed except script, iframe, frame, object, img and embed)
<p>Click the link to <a href="#paragraph">target the next paragraph</a>.</p> <p id="paragraph">This is the next paragraph.</p>
Show me!
Your results appear here: