Languages
[Edit]
EN

CSS - :target peseudo-class example

12 points
Created by:
Root-ssh
178260

:target pseudo-class is used to describe styles for element which has id attribute and url hash has been set to id value.

1. Simple example

Edit

Note: to see effect copy the code to server and type in browser addreses with hashes:

  • #bokmark-1 e.g. http://localhost#bookmark-1
  • #bokmark-2 e.g. http://localhost/#bookmark-2
  • #bokmark-3 e.g. http://localhost/index.htm#bookmark-3
:target pseudo-class simple example
:target pseudo-class simple example

2. Target navigation link with menu example

Edit
:target pseudo-class with navigation menu (link) example
:target pseudo-class with navigation menu (link) example

3. Article header styles example

Edit
:target pseudo-class with header element example
:target pseudo-class with header element example

 

1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.

CSS

Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join