Change cell color when hover

Discussion in 'ASP .Net' started by VB Programmer, Jun 11, 2004.

  1. How do you change the background/fg color of a cell when the mouse is
    hovered above it?

    Examples would be nice.
    VB Programmer, Jun 11, 2004
    #1
    1. Advertising

  2. <td onmouserover="self.bgcolor='#000000';"
    onmouseout"self.bgcolor='#FFFFFF';"></td>

    if you need more than one "state" of color, you probably want to write a
    javascript function to handle it.

    "VB Programmer" <RobertNZana*NoSpam-Please*@juno.com> ¦b¶l¥ó
    news:% ¤¤¼¶¼g...
    > How do you change the background/fg color of a cell when the mouse is
    > hovered above it?
    >
    > Examples would be nice.
    >
    >
    Lau Lei Cheong, Jun 11, 2004
    #2
    1. Advertising

  3. VB Programmer

    Jos Guest

    "Lau Lei Cheong" <> wrote in message
    news:%...
    > <td onmouserover="self.bgcolor='#000000';"
    > onmouseout"self.bgcolor='#FFFFFF';"></td>
    >
    > if you need more than one "state" of color, you probably want to write a
    > javascript function to handle it.


    Your code doesn't work with me. But this works:

    <td onmouseover="this.style.backgroundColor='red';"
    onmouseout="this.style.backgroundColor='#FFFFFF';" >
    test
    </td>

    Jos
    Jos, Jun 11, 2004
    #3
  4. Thanks. How about the foreground color, font-bold, etc...?

    "Jos" <> wrote in message
    news:...
    >
    > "Lau Lei Cheong" <> wrote in message
    > news:%...
    > > <td onmouserover="self.bgcolor='#000000';"
    > > onmouseout"self.bgcolor='#FFFFFF';"></td>
    > >
    > > if you need more than one "state" of color, you probably want to write a
    > > javascript function to handle it.

    >
    > Your code doesn't work with me. But this works:
    >
    > <td onmouseover="this.style.backgroundColor='red';"
    > onmouseout="this.style.backgroundColor='#FFFFFF';" >
    > test
    > </td>
    >
    > Jos
    >
    >
    VB Programmer, Jun 11, 2004
    #4
    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. Mufasa
    Replies:
    2
    Views:
    436
    Mufasa
    Jul 3, 2008
  2. Rahul
    Replies:
    7
    Views:
    3,768
    Jonathan N. Little
    Jul 24, 2009
  3. Ken Williams

    Change href color on hover?

    Ken Williams, May 2, 2011, in forum: HTML
    Replies:
    3
    Views:
    16,847
    Helpful person
    May 3, 2011
  4. Gary
    Replies:
    13
    Views:
    560
  5. Krys

    Change link color on div hover

    Krys, Jun 7, 2009, in forum: Javascript
    Replies:
    20
    Views:
    477
    Thomas 'PointedEars' Lahn
    Jun 10, 2009
Loading...

Share This Page