2 replies [Last post]
CSSelgreco1965
CSSelgreco1965's picture
Offline
Enthusiast
Greece
Last seen: 10 years 21 weeks ago
Greece
Timezone: GMT+3
Joined: 2004-06-13
Posts: 51
Points: 28

Hi!

I'm sure this is real basic, but I just can't think at the moment.

I have a "a href link" in a "table td" and I want the "td bg" to change colour when you roll over the "a href" link as well as the text.

Can anyone help.

Thanks in advance.

The web becomes a tangled mess when Microsoft gets involved!

thepineapplehead
thepineapplehead's picture
Offline
Guru
Last seen: 26 weeks 3 days ago
Joined: 2004-06-30
Posts: 9674
Points: 810

Link in table, that needs highlighting

There's some ways with javascript over at Dynamic Drive, but the easiest way is this.

Give the <a > a class, eg <a class="hoverlink" > link </a >

Then, if the td has a fixed width and height, change the link properties to them, eg

.hoverlink a {
width: 150px;
height: 25px;
background: #color;
}

then do:

.hoverlink a:hover {
background: #hovercolor;
}

This should work. (Unless you have table padding and spacing).

Verschwindende wrote:
  • CSS doesn't make pies

CSSelgreco1965
CSSelgreco1965's picture
Offline
Enthusiast
Greece
Last seen: 10 years 21 weeks ago
Greece
Timezone: GMT+3
Joined: 2004-06-13
Posts: 51
Points: 28

Link in table, that needs highlighting

I have managed to do it using the <li> and block control.

If you want the full list then ask and I'll post it.

Thanks anyway.

The web becomes a tangled mess when Microsoft gets involved!