Li:hover Question

Discussion in 'CSS' started by Sam Designs, Nov 19, 2007.

  1. #1
    #leftcolumn ul ul li:hover{
    background: #8dd24d;
    }

    When i do that in FF, the code works fine and when i hover over the li - the background changes. But in IE6, it doesn't seem to work - is there another setting for li: that applies to IE6 aswell?
     
    Sam Designs, Nov 19, 2007 IP
  2. dvirhazout

    dvirhazout Active Member

    Messages:
    691
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    60
    #2
    I need the answer for this question too :)
    waiting for css experts...
    btw- is this working on IE7?
     
    dvirhazout, Nov 19, 2007 IP
  3. KatieK

    KatieK Active Member

    Messages:
    116
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    58
    #3
    The problem is that IE6 only supports :hover on anchor tags (a) not on lis. the best workaround for this is to use JavaScript to enable that support. Try the Whatever:hover javascript: http://www.xs4all.nl/~peterned/csshover.html#changes.

    IE7 does support :hover on tags other than anchors. Are you having a problem in IE7, dvirhazout?
     
    KatieK, Nov 19, 2007 IP
    dvirhazout likes this.
  4. Sam Designs

    Sam Designs Active Member

    Messages:
    474
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #4
    I've read the page and understand how exactly it works, but when i put behavior:url("../htc/hover.htc"); it didn't work. Is that the right way to implement it? The CSS file is in /Template/, the .htc file is in /Template/htc/.
     
    Sam Designs, Nov 20, 2007 IP
  5. DKameleon

    DKameleon Member

    Messages:
    29
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    38
    #5
    Yes, it is the right way.
    You can see how it's working on my websites:
    http://dkameleon.com (second menu item on top)
    http://currex.ru (third menu item)
    Here is used inclusion:
    <!--[if lt IE 7]>
    <style type="text/css">
    	body { behavior: url(lib/csshover.htc); }
    </style>
    <![endif]-->
    Code (markup):
    PS. May be you have some browser limitations enabled?

    PPS. Just noticed. Looks like you have to manu points in path. Should be:
    behavior:url("./htc/hover.htc");
    or you can try from root:
    behavior:url("/Template/htc/hover.htc");
     
    DKameleon, Nov 20, 2007 IP
  6. Sam Designs

    Sam Designs Active Member

    Messages:
    474
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #6
    Sam Designs, Nov 20, 2007 IP
  7. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #7
    You also need to make sure that the server is configured to send the proper MIME type to Internet Explorer 6. Also note that you do not need conditional comments to serve the file - just using the * html hack to serve the .htc file will work (not to mention saving code and cutting down on needless HTTP requests).
     
    Dan Schulz, Nov 20, 2007 IP