target Selector

target Selector
CSS target Selector reference
The CSS target pseudo-class selector ( X: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.
CSS CODE EXAMPLE
<!DOCTYPE html>
<style type="text/css">
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 id="s1">Document section 1...</p>
<p id="s2">Document section 2...</p>
<p id="s3">Document section 3...</p>
<p id="s4">Document section 4...</p>
Demo Hint: To see the effect of this start clicking my document section links below.
 
Section 1 • Section 2 • Section 3 • Section 4
Document section 1...
Document section 2...
Document section 3...
Document section 4...

Related Posts :

  • left left CSS left Property The CSS left property is used to offset an element's left… Read More...
  • elevation elevation CSS elevation Property The CSS elevation property is part of CSS aural… Read More...
  • max-width max-width CSS max-width Property The CSS max-width property is used to specify t… Read More...
  • empty-cells empty-cells CSS empty-cells Property The CSS empty-cells property is used to spe… Read More...
  • max-height max-height CSS max-height Property The CSS max-height property is used to set th… Read More...

0 Response to "target Selector"

Post a Comment