The :target CSS pseudo-class selects the target element of the document. When the document is loaded, the target element is derived using the document's URL fragment identifier.
/* Selects document's target element */
:target {
border: 2px solid black;
}
For example, the following URL has a fragment identifier (denoted by the # sign) that marks the element with the id of setup as the document's target element:
http://www.example.com/help/#setup
The following element would be selected by a :target selector when the current URL is equal to the above:
<section id="setup">Installation instructions</section>