:target

Selects an element that is a target; i.e. that has an ID with the same value as the URL's hash.

Testsheet:

p:target {color: red;}

This paragraph has id="testHash". If you target this by #testHash it should become red.