SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Thread: link display

  1. #1
    SitePoint Addict TBanks's Avatar
    Join Date
    Jan 2003
    Location
    Earth:\USA\California
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    link display

    Hi,

    I'm using the following for link display

    Code:
    a:link, a:visited {
    		text-decoration: none;
    		background-color: transparent;
    		color: #cccc99;
    }
    
    a:hover, a:active {
    		text-decoration: underline;
    }
    I want the links to display without an underline until you mouse over (hover) - at which point the link becomes underlined. The visited link should look the same as the default link. This looks great in mozilla firebird, netscape and opera - however, in IE (6 at least), once I click on the link and navigate back to the page (with the links) the link that I clicked is still underlined (until I mouse over another link). Is the browser not reading the 'a:visited' code (a bug perhaps?), or am I coding this incorrectly?

    Thanks

    Toni
    dare to Dream, dare to Be...
    www.eodweb.com

  2. #2
    SitePoint Zealot
    Join Date
    Sep 2003
    Location
    Birmingham UK
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i'm assuming that the link that you're looking at is then in its active state (being the last link/element that was used on the page), which as defined in your stylesheet, will be underlined.

    i'd take a:active out of the underlined style, and put it in with the link and visited style above it.
    Rich.
    Late Night, Cold Coffee: Like daytime, but darker.

  3. #3
    SitePoint Addict TBanks's Avatar
    Join Date
    Jan 2003
    Location
    Earth:\USA\California
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by RichPearce
    i'm assuming that the link that you're looking at is then in its active state (being the last link/element that was used on the page), which as defined in your stylesheet, will be underlined.
    that would make sense - but then I don't understand why the other browsers display it without the underline?

    dare to Dream, dare to Be...
    www.eodweb.com

  4. #4
    SitePoint Evangelist N9ne's Avatar
    Join Date
    Aug 2002
    Location
    England
    Posts
    581
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Basically, IE does this because when you click the link, it's activated, and when you go back, you've just 'gone back' to the last action, which is, therefore clicking the link so it's as if the link is still being clicked.

  5. #5
    SitePoint Addict TBanks's Avatar
    Join Date
    Jan 2003
    Location
    Earth:\USA\California
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks!
    dare to Dream, dare to Be...
    www.eodweb.com

  6. #6
    SitePoint Addict TBanks's Avatar
    Join Date
    Jan 2003
    Location
    Earth:\USA\California
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    FYI for those interested - I've just read in Jeffrey Zeldman's "Designing With Web Standards" (GREAT book by the way!) on p242

    Note that even in its latest, greatest incarnation (at least as of this writing) Internet Explorer for Windows has trouble with the hover and active pseudo-classes. Hover states tend to get stuck. Use your Back button in IE/Windows, and you will very likely find that the last link you moused over is still in its hover state. For that matter, you will very likely find that the link you clicked to move forward is still in its active state.

    hmmm...

    his solution

    If your audience includes IE/Windows users (and whose audience does not?) you might decide to avoid a:active altogether. Or you might choose, as we have, not to do anything especially creative or challenging with it.
    and a humorous final note

    Whether this feezing of link states is a bug or a useful feature depends on whom you ask. Two hundred million IE/Windows users are probably accustomed to it by now, and many might believe the web is supposed to work this way.
    T
    dare to Dream, dare to Be...
    www.eodweb.com


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
  •