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

Chapter 6. Forms and User Interfaces > How do I highlight a field when the user...

6.3. How do I highlight a field when the user tabs into or clicks on it?

It’s a nifty effect to highlight a field when it has focus and is ready to be typed in.

6.3.1. Solution

The effect we can see in Figure 6-6 is created by adding rules for the :focus dynamic pseudo-class to our stylesheet. I’m using the same markup as used in the previous example:


  

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