SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Talking When does a:focus apply?

    When does a:focus apply? I thought that a link would have focus when the dotted box appears around a link in IE, like when a user tabs to the link using the keyboard. I've written my stylesheet like the following:

    Code:
    	a:link { color: #000; }
    	a:visited { color: #696969; }
    	a:hover { color: #696969; }
    	a:active { color: #696969; }
    	a:focus { color: red; }
    I never seem to have red links. Any ideas?

  2. #2
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IE is reputably not the most standards-compliant browser. Have you tried in Mozilla?

  3. #3
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    No, I haven't yet tried Mozilla. I wanted to get it working in IE first, and then make it work in other browsers. Am I right in thinking that a:focus is when the dotted lines appear around a link?

  4. #4
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by randem
    IE is reputably not the most standards-compliant browser. Have you tried in Mozilla?
    Just for the record...

    I trust you are referring to IE for Windows as IE 5/5.1 for Mac is actually reputed to be *the most standards-compliant browser* available on any platform.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  5. #5
    morphine for a wooden leg randem's Avatar
    Join Date
    Jun 2002
    Location
    .chicago.il.us
    Posts
    957
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Bill Posters

    Just for the record...

    IE 5/5.1 for Mac is actually reputed to be *the most standards-compliant browser* available on any platform.
    ... according to Microsoft ... and only regarding versions of HTML and CSS that are no longer the current standard ...

    In actuality, no single browser is to my knowledge 100% compliant with the latest standards. That said, Mozilla, is at least as compliant as IE 5/mac (arguably more so), and works the same on all platforms, including Linux and Windows, and not just MacOS 9.

    ...back on topic...

    I tried the style provided in Mozilla, and the focused link turned red, as you expected, when the dotted focus box surrounds the link. In fairness, I also tried the same code in IE, and the color did not change.

    So I dug a little deeper, and after changing the color of the a:active style, I learned that IE is applying the Active style where Mozilla applies the Focus style.

    And so, as I said before, IE is not performing as specified by the W3C CSS standard. For more information, visit here.

  6. #6
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    27
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for your help. I guess I'll just have to live without using the focus pseudo-element in IE.


Bookmarks

Posting Permissions

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