Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Toronto
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts

    An IE7 hover problem

    I have a problem getting IE7 to apply a hover style and no matter what I have tried or where I have googled I haven't been able to come up with a workaround. The code works on all other browsers and on IE8, but from what I have read, IE7 is pretty buggy in this area.

    I've extracted this code from a much larger app in order to isolate the problem. What I'm down to is as follows:

    <table><tr>
    <td width="120" align="center" valign="top">
    <div class="IE7Open"><a class="IE7OpenLink">TentName</a></div>
    </td></tr></table>

    The style is:

    .IE7Open {border-style: solid; border-color: #003399; border-width: 1px; background-color:#a8cefc;
    width: 100px; height: 16px; font-family: Arial, Helvetica, sans-serif; font-size: 13px; margin-bottom: 5px;}
    .IE7OpenLink {text-decoration:none;}
    a:hover.IE7OpenLink {color: #C700FF; font-weight:bold; cursorointer; }

    I know it may look a little odd extracted like this, but trust me, the source page is far more complicated and tough to read.

    Any suggestions on how to get IE7 to apply the hover?

  • #2
    Senior Coder tomws's Avatar
    Join Date
    Nov 2007
    Location
    Arkansas
    Posts
    2,644
    Thanks
    29
    Thanked 330 Times in 326 Posts
    Try this instead:
    Code:
    a.IE7OpenLink:hover{/*whatever here*/}
    Are you a Help Vampire?

  • #3
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Toronto
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    No, that didn't change anything. Still works fine in all places except IE7.

    Thanx for suggesting.

  • #4
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,737
    Thanks
    22
    Thanked 1,836 Times in 1,820 Posts
    Hello jpullam,
    What DocType is your site using? There is some advantage to be gained in CSS conformity by using a Strict DocType when dealing with hover issues, as well as many other issues, in IE7.
    http://blogs.msdn.com/ie/archive/2006/08/22/712830.aspx


    ...
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • #5
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Toronto
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 //EN" "http://www.w3.org/TR/html4/strict.dtd">

  • #6
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Toronto
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I've gotten it down to its most basic form and still it won't work!!

    The page has

    <a class="IE7OpenLink">Any Name</a>

    and CSS is

    a.IE7OpenLink:hover {text-decoration:none; color: #C700FF; font-weight:bold;}

    and it doesn't work in IE7. It seems so elemental. In fact other hover's do work in IE7. What am I missing?

  • #7
    Master Coder Excavator's Avatar
    Join Date
    Dec 2006
    Location
    Alaska
    Posts
    9,737
    Thanks
    22
    Thanked 1,836 Times in 1,820 Posts
    <a class="IE7OpenLink">Any Name</a> is invalid!

    Try this in IE7 -
    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>Untitled Document</title>
    <style type="text/css">
    a.IE7OpenLink:hover {text-decoration:none; color: #C700FF; font-weight:bold;}
    </style>
    </head>
    <body>
    <a href="#" class="IE7OpenLink">Any Name</a>
    </body>
    </html>
    Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
    Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad

  • Users who have thanked Excavator for this post:

    jpullam (12-03-2009)

  • #8
    New to the CF scene
    Join Date
    Dec 2009
    Location
    Toronto
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I'm not sure that I agree that <a class="IE7OpenLink">Any Name</a> is really invalid. The original HTML contained an onclick handler (and a lot more) and I just removed things to get down to the real basics that showed where the problem actually was. But if you are saying that putting in an href="#" will fix it, then I'm glad to do that.

    And yes, it seems that did fix it, so thanks a lot.

  • #9
    Senior Coder
    Join Date
    Oct 2005
    Posts
    1,340
    Thanks
    0
    Thanked 61 Times in 60 Posts
    IE in general doesn't handle the DOM well at all so you probably need a href for it to fill the tree out as best it can.


  •  

    Posting Permissions

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