TD border color on mouseover

Discussion in 'HTML' started by Carl Gilbert, Jul 18, 2005.

  1. Carl Gilbert

    Carl Gilbert Guest

    Hi

    I wish to change the color of a cell border when the mouse passes over the
    cell.

    The code I currently have for the cell is as follows:
    <TD height="76" width="328" style="border-color: black; border-style:
    solid; border-width: 4;"> </TD>

    I am using ASP.NET and VB.NET if that makes thing easier and I would prefer
    not to use CSS.

    Can anyone suggest a method to change the border color?

    Regards, Carl Gilbert
     
    Carl Gilbert, Jul 18, 2005
    #1
    1. Advertising

  2. Carl Gilbert

    Adrienne Guest

    Gazing into my crystal ball I observed "Carl Gilbert"
    <> writing in
    news:QrVCe.2990$:

    > Hi
    >
    > I wish to change the color of a cell border when the mouse passes over
    > the cell.
    >
    > The code I currently have for the cell is as follows:
    > <TD height="76" width="328" style="border-color: black;
    > border-style:
    > solid; border-width: 4;"> </TD>
    >
    > I am using ASP.NET and VB.NET if that makes thing easier and I would
    > prefer not to use CSS.
    >
    > Can anyone suggest a method to change the border color?
    >
    > Regards, Carl Gilbert
    >
    >
    >


    ASP and ASP.Net know nothing of a mouse passing over anything. That's
    client side, and for IE, which only honors hover on the A element, you
    would have to use javascript to accomplish this.

    What to do you have against CSS? CSS makes things _much_ easier, for
    example:

    <% while not rs.EOF
    c = c + 1
    if mod c 2 = 0 then
    trcolor = colora
    else
    trcolor = colorb
    end if
    %>
    <tr class="<%=trcolor%>">
    <td>data</td>
    </tr>
    <% rs.Movenext
    wend
    rs.Close
    set rs = nothing
    %>

    Now colora and colorb could be defined in an external stylesheet:
    ..colora {background-color:#000; color:#fff;}
    ..colorb {background-color:#fff; color:#000;}

    If you decide to change the colors or attributes of that class later, it's
    only a matter of changing the stylesheet, not the document.

    --
    Adrienne Boswell
    http://www.cavalcade-of-coding.info
    Please respond to the group so others can share
     
    Adrienne, Jul 18, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?UTF-8?B?TWFydGluIFDDtnBwaW5n?=

    border-color: #003366; border-width: 2px;

    =?UTF-8?B?TWFydGluIFDDtnBwaW5n?=, Jul 17, 2006, in forum: HTML
    Replies:
    64
    Views:
    3,569
    Adrienne Boswell
    Jul 30, 2006
  2. kaston3
    Replies:
    1
    Views:
    571
    Andrew Bailey
    Feb 19, 2008
  3. Anthony Jones
    Replies:
    0
    Views:
    690
    Anthony Jones
    Feb 17, 2009
  4. Kamaljeet Saini
    Replies:
    0
    Views:
    450
    Kamaljeet Saini
    Feb 13, 2009
  5. Replies:
    1
    Views:
    282
    marss
    Feb 14, 2007
Loading...

Share This Page