Forum Moderators: open
td.bgc: hover {background-color: #ffff00}
put that in the stylesheet, and this in the body:
<td class="bgc">cont</td>
You can then replace the color in the stylesheet by {background-image: url(whatever.png)}
This can also work for paragraphs, or <em>, or anything else, which might be better of you're not working with actual tabular data.
This is the CSS code I am using
td.test5 {
background-image: url(test-blue.gif);
}td.test5:hover {
background-image: url(test-green.gif);
}
And I have named the class for td = test5
When I see the td in the browser I see test-blue.gif as the bg color, however, on mouseover, it does not change to text-green.gif :(
Can you tell me where I am doing wrong?
NS
All you need to do is create TWO classes, e.g., "bgout" and bgover"
.bgout {
background-image: url(test-blue.gif);
}
.bgover {
background-image: url(test-green.gif);
}
Then, inside the cell write:
<td class="bgout"onmouseover="this.className='bgover'" onmouseout="this.className='bgout'">