33 users online (0 members and 33 guests)  


  Results 1 to 4 of 4

Related

  1. Replies: 4
  2. Unix command output displayed 0 in browser    Forum: CGI Perl Forum
    Replies: 0
  3. Replies: 0
  4. Replies: 1
  5. Replies: 2
  1. #1
    hbass's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Colorado
    Posts
    71

    Hover command on a td

    Hi All,
    I hope you haven't already addressed this, couldn't find it in the search option.

    Here is my css:
    .DDmenu {
    font-family: Geneva, Arial, Helvetica, sans-serif;
    font-size: 12px;
    color: #FFFFFF;
    padding: 3px;
    border: 1px solid #CCCCCC;
    text-align: center;
    vertical-align: middle;
    background-color: #000000;
    }
    .DDmenu a:link {
    color: #FFFFFF;
    text-decoration: none;
    }
    .DDmenu a:hover {
    color: #FFFFFF;
    background-color: #990033;
    text-decoration: none;
    }

    I have my link text in a table, each link in it's own cell, and I want the entire cell to change color, rather than just behind the text that is linked when you roll over it. I tried applying the class to the td tag rather than to a p tag, but that didn't do it. What do I need to do from here?

  2. #2
    HTML's Avatar
    Administrator

    Status
    Offline
    Join Date
    Aug 2000
    Posts
    3,445

    Follow HTML On Twitter Add HTML on Facebook Add HTML on Google+ Add HTML on Linkedin Visit HTML's Youtube Channel

    Re: Hover command on a td

    hi hbass

    See if this short thread is of help
    http://www.ahfb2000.com/webmaster_he...ead.php?t=1013

    D
    AHFBWEB Less customers per server, more power for you!

    Business Class Shared Hosting

  3. #3
    coothead's Avatar
    bald headed old fart

    Status
    Offline
    Join Date
    Aug 2003
    Location
    chertsey, a small town 25 miles south west of london, england.
    Posts
    732

    Re: Hover command on a td

    Hi there hbass,

    try it like this...
    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <title>display block anchors</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    background-color:#ccc;
    color:#000;
    }
    table {
    background-color:#fff;
    color:#000;
    border:1px solid #000;
    margin:40px auto;
    }
    .DDmenu {
    font-family: geneva, arial, helvetica, sans-serif;
    font-size: 12px;
    border: 1px solid #ccc;
    text-align: center;
    }
    .DDmenu a {
    display:block;
    width:324px;
    line-height:200px;
    color: #fff;
    background-color: #000;
    text-decoration: none;
    }
    .DDmenu a:hover {
    color: #fff;
    background-color: #903;
    }
    -->
    </style>
    </head>
    <body>
    <table><tr>
    <td class="DDmenu"><a href="#">link</a></td>
    <td class="DDmenu"><a href="#">link</a></td>
    </tr><tr>
    <td class="DDmenu"><a href="#">link</a></td>
    <td class="DDmenu"><a href="#">link</a></td>
    </tr></table>
    </body>
    </html>
    ...setting the anchor to display:block and defining it's dimensions is the key.

  4. #4
    hbass's Avatar
    Junior Member

    Status
    Offline
    Join Date
    Mar 2004
    Location
    Colorado
    Posts
    71

    Re: Hover command on a td

    Thanks Coothead,

    Display Block was exactly what I was missing! It works beautifully.



Tags for this Thread