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
  • DownloadDownload
  • PrintPrint

Focus on Input

Have you ever been busily typing away in a form when you realized that you were actually typing in the wrong place? This kind of problem wastes time and is also mildly annoying. Through the magic of CSS, you can highlight elements that content authors are currently working in. To get this functionality to work, you must use another CSS pseudo-element: :focus, the long-lost relative of :hover (which is typically used in styling links). This enhancement is not supported by all Web browsers.

#node-form .form-item input:focus,
  #node-form .form-item textarea:focus {
       background-color: #e0edba;
       border: 2px solid green;
       border-top: 2px solid #eee;
       border-left: 2px solid #eee;
}


  

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