CSS menu mouseover query

Discussion in 'CSS' started by MikeyP, Oct 24, 2007.

  1. #1
    Using I/Explorer in Windows XP the mouseover effect only works on the text, but using I/Explorer in Vista it works on the entire table cell. We would like the effect to work on the entire cell for visitors using XP as well. Anyone suggest how/if we can modify the code for this? Here it is --

    .buttonscontainer {width: 200px;}
    .buttons a {color: #006699;
    background-color: #F1F3F5;
    padding: 2px;
    padding-left: 9px;
    display: block;
    border-bottom: 1px solid #DDDDDD;
    border-left: 6px solid #2872B6;
    font: 12px Arial, sans-serif;
    font-weight: bold;
    text-decoration: none;
    text-align: left;}

    .buttons a:hover {color: #1E6CA2;
    text-decoration: underline;
    background-color: #FFFFFF;
    border-left: 6px solid #9544F0; }

    and here is how the html looks (all within 1 table cell) --

    <div class="buttonscontainer">
    <div class="buttons">
    <a href="intro.htm">Introduction</a>
    <a href="essential.htm">The xxx business</a>
    <a href="earnings.htm">Financial rewards</a>
    <a href="package.htm">The package</a>
    <a href="faqs.htm">FAQ's</a>
    <a href="guidance.htm">The manual</a>
    <a href="additions.htm">Software & website</a>
    <a href="testimonials.htm">Testimonials</a>
    <a href="benefits.htm">Summary of benefits</a>
    <a href="about.htm">About / Contact us</a>
    </div>
    </div>


    Thanks
    Mikey
    --
     
    MikeyP, Oct 24, 2007 IP
  2. webdesigner

    webdesigner Well-Known Member

    Messages:
    489
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    110
    #2
    I take it that you are using IE6 on XP and Vista has IE7 installed hence the difference.

    Any chance of a link to the page in question?
     
    webdesigner, Oct 24, 2007 IP
  3. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This is a popular "bug." I doubt it's XP and Vista that's the problem, but IE6 vs IE7. If this is internal only, just upgrade everyone to IE7. Otherwise, you need javascript.

    IE6 only obeys :hover on anchors <a> but nothing else. You can add an .htc file from Peterned (sorry I can't find the actual file because I've got it bookmarked on my machine only) or there are like 12 lines of Javascript you can find at the Suckerfish page at HTMLdog.

    I believe these 3 are your only choices.
     
    Stomme poes, Oct 24, 2007 IP
  4. MikeyP

    MikeyP Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    OK webdesigner has provided me the solution by PM, as follows:

    Simply add a tag height in the css, thus--

    .buttonscontainer {width: 200px;}
    .buttons a {color: #006699;
    height: 20px;
    background-color: #F1F3F5;
    padding: 2px;
    padding-left: 9px;
    display: block;
    border-bottom: 1px solid #DDDDDD;
    border-left: 6px solid #2872B6;
    font: 12px Arial, sans-serif;
    font-weight: bold;
    text-decoration: none;
    text-align: left;}

    Works great in IE7 also FFox. :D

    MikeyP
    ==
     
    MikeyP, Oct 25, 2007 IP
  5. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #5
    Yup - and here's why. Adding a height trips 'haslayout'. If you do not want to fix the height, and the container itself isn't set to overflow:hidden or auto and is not inside a container that has a height, you can use height:1%; safely there (since % heights are changed to height:auto if the wrapping container has no height declared, but still trips haslayout) - aka the so called 'holly hack'.
     
    deathshadow, Oct 25, 2007 IP
  6. MikeyP

    MikeyP Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Thanks deathshadow. nice name ;-(

    ==
     
    MikeyP, Oct 25, 2007 IP