This topic has not yet been rated - Rate this topic

:target pseudo-class

[This documentation is preliminary and is subject to change.]

Applies one or more styles to the target element of the referring Uniform Resource Identifier (URI).

Selectors Level 3, Section 6.6.2

Syntax

selector:target {...}

Parameters

selector

A CSS simple selector.

Standards information

Remarks

The :target pseudo-class selects the target element of the referring URI. A fragment identifier is used to identify a location within a document, and is formed using a number sign followed by an anchor identifier—for example, http://www.example.com/mypage.html#section_3.

Examples

The following selects the div element of class important that is the target element of the referring URI. If the document's URI has no fragment identifier, there is no target element.


div.important:target

 

 

Build date: 3/13/2012

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ