CSS :hover and Internet Explorer 6?

Discussion in 'HTML' started by Erik Harris, Jun 25, 2003.

  1. Erik Harris

    Erik Harris Guest

    Does Internet Explorer 6 support the CSS ":hover" attribute, or am I simply
    doing something wrong? All of the links on my websites (linked to in my
    signature) change color when the mouse hovers over them in Mozilla, but
    nothing happens in Internet Explorer 6.

    --
    Erik Harris n$wsr$ader@$harrishom$.com
    AIM: KngFuJoe http://www.eharrishome.com
    Chinese-Indonesian MA Club http://www.eharrishome.com/cimac/

    The above email address is obfuscated to try to prevent SPAM.
    Replace each dollar sign with an "e" for the correct address.
    Erik Harris, Jun 25, 2003
    #1
    1. Advertising

  2. David Dorward, Jun 25, 2003
    #2
    1. Advertising

  3. "rf" <> wrote:

    > IE doesn't support a[href]:hover. Use a:hover or .content a:hover or
    > whatever.


    David's suggestion to use a:link:hover and a:visited:hover is better,
    since Mozilla treats :hover as applying to almost any element, so if
    there's e.g. <a name="...">...</a> somewhere, it would match a:hover.

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Jun 25, 2003
    #3
  4. Erik Harris

    rf Guest

    "Jukka K. Korpela" <> wrote in message
    news:Xns93A5865C755A3jkorpelacstutfi@193.229.0.31...
    > "rf" <> wrote:
    >
    > > IE doesn't support a[href]:hover. Use a:hover or .content a:hover or
    > > whatever.

    >
    > David's suggestion to use a:link:hover and a:visited:hover is better,
    > since Mozilla treats :hover as applying to almost any element, so if
    > there's e.g. <a name="...">...</a> somewhere, it would match a:hover.


    Good point.

    Cheers
    Richard.
    rf, Jun 25, 2003
    #4
  5. Erik Harris

    Erik Harris Guest

    On Wed, 25 Jun 2003 01:57:07 +0100, David Dorward <> wrote:

    >Erik Harris wrote:
    >
    >> Does Internet Explorer 6 support the CSS ":hover" attribute


    >Only on <a> elements


    That's kind of a pain, especially if you want it to behave differently on
    text links and image links. For example, I've got:

    a[href]:hover { color: #EEA; background: transparent; text-decoration:
    underline }
    a:hover IMG {border: 1px solid #EEA}

    Neither works. So apparently, IE not only doesn't support attribute
    selectors, but it also doesn't support context-dependent styles (a:hover
    IMG). I don't want the text links to have a 1 pixel solid border, so
    combining them into one doesn't appear to be an option.

    >> or am I simply doing something wrong?


    >MSIE doesn't support attribute selectors, so it doesn't recognise
    >a[href]:hover.


    >Use a:link:hover and a:visited:hover instead.


    The reason I didn't just use "a:hover" (or the above choices) is because I
    didn't want my <a name=""> place-mark links to be hilighted. And I believe
    the Validator balked at <a name="text"></a> (which is fine when its only
    purpose is to mark the beginning of a section) because it didn't like an
    empty <a></a>.

    --
    Erik Harris n$wsr$ader@$harrishom$.com
    AIM: KngFuJoe http://www.eharrishome.com
    Chinese-Indonesian MA Club http://www.eharrishome.com/cimac/

    The above email address is obfuscated to try to prevent SPAM.
    Replace each dollar sign with an "e" for the correct address.
    Erik Harris, Jun 26, 2003
    #5
  6. Erik Harris <n$wsr$ader@$harrishom$.com> wrote:

    > It still doesn't help the case of the contextual selector I'd like
    > to use, though (a:hover IMG), since IE only allows :hover with <a>,
    > and since I want borders around hovered link images, but not text
    > links.


    You can use e.g.

    :link img { border: solid blue thin; }
    :visited img { border: solid #939 thin; }
    :link:hover img, :visited:hover img { border-color: red; }

    --
    Yucca, http://www.cs.tut.fi/~jkorpela/
    Pages about Web authoring: http://www.cs.tut.fi/~jkorpela/www.html
    Jukka K. Korpela, Jun 26, 2003
    #6
  7. Erik Harris

    Erik Harris Guest

    On Thu, 26 Jun 2003 06:48:52 +0000 (UTC), "Jukka K. Korpela"
    <> wrote:

    >Erik Harris <n$wsr$ader@$harrishom$.com> wrote:
    >
    >> It still doesn't help the case of the contextual selector I'd like
    >> to use, though (a:hover IMG), since IE only allows :hover with <a>,
    >> and since I want borders around hovered link images, but not text
    >> links.

    >
    >You can use e.g.
    >
    >:link img { border: solid blue thin; }
    >:visited img { border: solid #939 thin; }
    >:link:hover img, :visited:hover img { border-color: red; }


    Thanks, I'll give that a go.

    --
    Erik Harris n$wsr$ader@$harrishom$.com
    AIM: KngFuJoe http://www.eharrishome.com
    Chinese-Indonesian MA Club http://www.eharrishome.com/cimac/

    The above email address is obfuscated to try to prevent SPAM.
    Replace each dollar sign with an "e" for the correct address.
    Erik Harris, Jun 26, 2003
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. cmay
    Replies:
    0
    Views:
    1,127
  2. Bubu
    Replies:
    3
    Views:
    644
  3. John
    Replies:
    1
    Views:
    2,014
    Adrienne Boswell
    Sep 16, 2008
  4. Ed Hauptman
    Replies:
    7
    Views:
    1,011
    Ed Hauptman
    Aug 7, 2009
  5. John Smith
    Replies:
    1
    Views:
    137
    Evertjan.
    Mar 12, 2005
Loading...

Share This Page