Special a:hover

Discussion in 'CSS' started by splatcatballa99, Jul 31, 2007.

  1. #1
    ok I have a table that contains my navigation
    
    table align='left' style='position: relative; top:-12px;' height='20'>
    <tr>
    <td class='nav'>
    <a href='index.php'>Home</a>
    </td>
    <td class='nav'>
    <a href='about.php'>About</a>
    </td>
    </tr>
    </table>
    
    Code (markup):
    And the corresponding CSS
    .nav {
    border-right: 1px solid #000000;
    font-weight: bold;
    color:#FFFFFF;
    font-size:18px;
    padding-right: 12px;
    padding-left: 10px;
    padding-top: 7px;
    }
    .nav a:hover {
    color:#9933FF;
    }
    .nav a:link {
    color:#FFFFFF;
    text-decoration: none;
    }
    
    Code (markup):
    But when you hover over a link in that table the color of the text doesn't change
     
    splatcatballa99, Jul 31, 2007 IP
  2. soulscratch

    soulscratch Well-Known Member

    Messages:
    964
    Likes Received:
    45
    Best Answers:
    0
    Trophy Points:
    155
    #2
    Try setting it in this over

    :link
    :visited
    :hover
    :active

    LoVe
    HAte
     
    soulscratch, Jul 31, 2007 IP
  3. splatcatballa99

    splatcatballa99 Well-Known Member

    Messages:
    400
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    130
    Digital Goods:
    1
    #3
    Thanks that worked :)
     
    splatcatballa99, Jul 31, 2007 IP
  4. Jezek

    Jezek Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If you're only changing the hover state you could just set style for the link, then set style for the hover..

    Example:

    a { color: #fff; }

    a:hover { color: #000; }
     
    Jezek, Aug 3, 2007 IP
  5. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    437
    Best Answers:
    0
    Trophy Points:
    0
    #5
    I'd also use an unordered list instead of a table.
     
    Dan Schulz, Aug 3, 2007 IP