pseudo-class
:target — CSS reference
Matches the element identified by the current document URL fragment. Only a matching target is selected; the selector does not create navigation or focus by itself.
Formal Syntax & Structure
css syntaxcss
:targetWorking Example
Example Snippetcss
<!doctype html><html lang="en"><meta charset="utf-8"><title>CSS reference lab</title><style>#a,#b {color:#202020} #a:target {color:#006050}</style><body><a href="#a">Jump to topic</a><p id="a">Topic</p><p id="b">Other</p></body></html>