Search within TutorialsPark

CSS Pseudo Class Selector :target


Selects the element referred to by the URL fragment identifier


Definition and Notes.

1. CSS Pseudo Selector :target selects and styles elements that can be accessed using a link that ends with a URL fragment i.e a hash sign(#) followed by an achor-name ot ID.

2. The styles will be applied only when the page is accessed using such a URL fragment( internally or externally). Or else its ignored

3. For example, :target will style the elements which are the target of URL fragments


Pattern:

CSS :targetPseudo Class selector. internetexplorer safari firefox opera chrome

View in Splitscreen»

Code-Editor:

Note: :target pseudo class matches element that the URL fragment link to.


Related Examples.