Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

2. Hacking with Style > Hack 18. Take Full Control of Your DOM with Pseudoclass...

Hack 18. Take Full Control of Your DOM with Pseudoclasses

You’ve been working with pseudoclasses for years with the few options available in CSS 2.1. Now, CSS3 allows you to use those implied classes on just about any element on the page.

Pseudoclasses are some of the more exciting parts of CSS. A pseudoclass is a class that is implied on an element based on its ability to satisfy generic criteria, such as the fact that a button is in the disabled state or that it is the first child of your parent element. The pseudoclass is written by preceding the class with a colon.

A few extremely popular pseudoclasses were introduced in CSS 2.1. One of the most common was the link hover class. It looked like this:

a:hover 

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint