changing background color of <td> when hovering

Discussion in 'HTML' started by max, Nov 6, 2006.

  1. max

    max Guest

    Hi all

    I don't succeed to change the background color in a <td> when hovering
    over it with the mouse.
    In this example
    http://www.bep-zuerich.ch/test_td_hover.htm
    the cell color of 'external' and 'internal' should change (not only the
    color under the letters).

    Can anybody help me? Thanks. Max.
    max, Nov 6, 2006
    #1
    1. Advertising

  2. max

    Ben C Guest

    On 2006-11-06, max <> wrote:
    > Hi all
    >
    > I don't succeed to change the background color in a <td> when hovering
    > over it with the mouse.
    > In this example
    > http://www.bep-zuerich.ch/test_td_hover.htm
    > the cell color of 'external' and 'internal' should change (not only the
    > color under the letters).
    >
    > Can anybody help me? Thanks. Max.


    Your class names are "ext" and "int" in the HTML but "external" and
    "internal" in the CSS.
    Ben C, Nov 6, 2006
    #2
    1. Advertising

  3. max

    max Guest

    Ben C schrieb:

    > On 2006-11-06, max <> wrote:
    > > Hi all
    > >
    > > I don't succeed to change the background color in a <td> when hovering
    > > over it with the mouse.
    > > In this example
    > > http://www.bep-zuerich.ch/test_td_hover.htm
    > > the cell color of 'external' and 'internal' should change (not only the
    > > color under the letters).
    > >
    > > Can anybody help me? Thanks. Max.

    >
    > Your class names are "ext" and "int" in the HTML but "external" and
    > "internal" in the CSS.


    Thank you. I corrected it.
    I should be able to change the cell background, too. But I don't
    succeed.
    Max.
    max, Nov 6, 2006
    #3
  4. Scripsit max:

    > I don't succeed to change the background color in a <td> when hovering
    > over it with the mouse.
    > In this example
    > http://www.bep-zuerich.ch/test_td_hover.htm
    > the cell color of 'external' and 'internal' should change (not only
    > the color under the letters).


    You aren't even trying to change the background of any cell (<td>), only the
    background of some links (<a>) inside cells. Does this give a clue?

    Setting
    display: block; width: 100%; height: 100%;
    for the links inside cells would probably do the trick you want.

    But you shouldn't cell sizes in pixels. Do you really need to use a _table_
    at all? You're not showing any real example, so this is just speculation.

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Nov 6, 2006
    #4
  5. max

    Nico Schuyt Guest

    Nico Schuyt, Nov 6, 2006
    #5
  6. max

    max Guest

    Jukka K. Korpela schrieb:

    > Scripsit max:
    >
    > > I don't succeed to change the background color in a <td> when hovering
    > > over it with the mouse.
    > > In this example
    > > http://www.bep-zuerich.ch/test_td_hover.htm
    > > the cell color of 'external' and 'internal' should change (not only
    > > the color under the letters).

    >
    > You aren't even trying to change the background of any cell (<td>), only the
    > background of some links (<a>) inside cells. Does this give a clue?
    >
    > Setting
    > display: block; width: 100%; height: 100%;
    > for the links inside cells would probably do the trick you want.
    >
    > But you shouldn't cell sizes in pixels. Do you really need to use a _table_
    > at all? You're not showing any real example, so this is just speculation.
    >
    > --
    > Jukka K. Korpela ("Yucca")
    > http://www.cs.tut.fi/~jkorpela/


    thanks a lot. with your settings (display: block; width: 100% ...) it
    worked.
    about table: no, I don't need a table. I actually use <div>. your
    settings work there, too.
    but I have another problem there: the navigation with <div> workes well
    now. I should, however, define links in the text in an other way than
    links in the navigation. how can I do this? can I split the a:hover
    into, say, a.normal:hover and a.navigation:hover? Here is my test file:
    http://www.bep-zuerich.ch/test_div_hover.htm
    and here is the website I really work with (test version):
    http://www.bep-zuerich.ch/0_neu5.php
    Thanks for any help. Max.
    max, Nov 6, 2006
    #6
  7. max

    max Guest

    Nico Schuyt schrieb:

    > max wrote:
    > > I don't succeed to change the background color in a <td> when hovering
    > > over it with the mouse.

    >
    > Maybe something like:
    > http://www.nicoschuyt.nl/test/hover-table-cell-link.htm
    >
    > --
    > Nico Schuyt
    > http://www.nicoschuyt.nl/


    Thanks a lot. your suggestion works perfectly. the problem with the
    navigation is solved. but a new problem arose. please see my answer to
    the message above. can you help again?
    thanks, max.
    max, Nov 6, 2006
    #7
  8. max

    dorayme Guest

    In article <454f1923$0$40063$>,
    "Nico Schuyt" <> wrote:

    > max wrote:
    > > I don't succeed to change the background color in a <td> when hovering
    > > over it with the mouse.

    >
    > Maybe something like:
    > http://www.nicoschuyt.nl/test/hover-table-cell-link.htm


    But that is unethical, it only makes it seem the cell is changing
    color. <g>

    --
    dorayme
    dorayme, Nov 7, 2006
    #8
  9. max

    Nico Schuyt Guest

    dorayme wrote:
    > "Nico Schuyt" wrote:
    >> max wrote:
    >>> I don't succeed to change the background color in a <td> when
    >>> hovering over it with the mouse.

    >>
    >> Maybe something like:
    >> http://www.nicoschuyt.nl/test/hover-table-cell-link.htm

    >
    > But that is unethical, it only makes it seem the cell is changing
    > color. <g>


    I confess; no support of tr/td hover in IE6 :) I wonder if IE7 does.

    --
    Nico Schuyt
    http://www.nicoschuyt.nl/
    Nico Schuyt, Nov 8, 2006
    #9
    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?TmVpbA==?=

    DataGrid, changing background color of a Row?

    =?Utf-8?B?TmVpbA==?=, Oct 7, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    642
    =?Utf-8?B?TmVpbA==?=
    Oct 7, 2004
  2. fig000
    Replies:
    0
    Views:
    4,529
    fig000
    Sep 6, 2004
  3. Kamaljeet Saini
    Replies:
    0
    Views:
    376
    Kamaljeet Saini
    Feb 13, 2009
  4. Dj Frenzy
    Replies:
    3
    Views:
    291
    Robert
    Feb 10, 2004
  5. Replies:
    1
    Views:
    257
    marss
    Feb 14, 2007
Loading...

Share This Page