Hosting Solutions
mobile_logo Table of Contents
seal_frontseal_back

target

The target pseudo-class selector target is used to alter the style of an element when it is the document uri target. This is most commonly applied when you have long documents in which there is internal document navigation leading users to specific sections of the document.
Syntax Logicelement:target { property_list }

CSS Code Example

<style> p:target { color:#F00; } </style> <a href="#s1">Section 1</a> &bull; <a href="#s2">Section 2</a> &bull; <a href="#s3">Section 3</a> &bull; <a href="#s4">Section 4</a> <p name="s1" id="s1">Document section 1...</p> <p name="s2" id="s2">Document section 2...</p> <p name="s3" id="s3">Document section 3...</p> <p name="s4" id="s4">Document section 4...</p>

CSS

Selectors

universaltypecompoundclassidnotattributedescendantchildadjacent siblinggeneral siblingfirst childlast childonly childfirst of typelast of typeonly of typenth childnth last childnth of typenth last of typeemptyrootfirst linefirst letterbeforeafterlinkvisitedhoveractivefocustargetenableddisabledcheckedlang