Results 1 to 2 of 2

Thread: class:focus

  1. #1
    Join Date
    Nov 2009
    Posts
    2

    class:focus

    Hello,
    I saw this CSS syntax for a class called "text"

    .text:focus

    what it is and what other parameters can take ?

    Thanks

  2. #2
    Join Date
    Feb 2006
    Location
    Salisbury UK
    Posts
    4,332
    For anchors you have five states:-
    a:link, a:visited, a:hover, a:active, a:focus { color: blue; }
    In IE6 you can only have the states on the "a" tag but in modern browsers you can have them on any element, in the above case the class could be for a "a" tag or some other element.

    The main feature of focus is to help people who use the tab key for tabbed browsing instead of a mouse, which means that they cannot highlight a link by hovering the mouse. Some disabled people cannot use a mouse, other people who use a laptop may not have a mouse and don't use the touch pad and others prefer to use tabbed browsing. See http://www.mahudsblog.ourgardenpath.com/?p=694 for some general advice. As you use the tab key it should highlight the links one by one according to your style setting so that the viewer always knows which link will activate when he uses the Enter key. IE doesn't support a:focus, using a:active instead.
    Code downloaded to my PC will be deleted in due course.
    WIN7; IE9, Firefox, Opera, Chrome and Safari for Windows; screen resolution usually 1366*768.
    Also IE6 on W98 with 800*600 and IE8 on Vista 1440*900.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •