Jump to content

Archived

This topic is now archived and is closed to further replies.

barkster

Highlight cell when hover over?

Recommended Posts

Is it possible to change the background color of a cell when you hover over it? Would not contain any text in the cell. Using just CSS would be great, javascript if needed. I think I've seen it with javascript but can't figure out with CSS. Thanks

Well guess I should have googled first, pretty easy

<td bgcolor="#FFFFFF" onmouseover="style.backgroundColor='#84DFC1';" onmouseout="style.backgroundColor='#FFFFFF'">&nbsp;</td>

Share this post


Link to post
Share on other sites
I also have a question very similiar to this. How do you create a cell where the whole row is a link, not just the text?

Share this post


Link to post
Share on other sites
1st question: td:hover pseudoclass. Only works in anything but IE though.
2nd question: set the <a> tag to display as a block and use it to surround everything in the cell.

Share this post


Link to post
Share on other sites
[!--quoteo(post=358044:date=Mar 24 2006, 08:37 PM:name=lpxxfaintxx)--][div class=\'quotetop\']QUOTE(lpxxfaintxx @ Mar 24 2006, 08:37 PM) [snapback]358044[/snapback][/div][div class=\'quotemain\'][!--quotec--]
I also have a question very similiar to this. How do you create a cell where the whole row is a link, not just the text?
[/quote]


Or you can do:

[code]<tr>
    <td style="background-color:#FFFFFF" onmouseover="this.style.backgroundColor='#EEEEEE'" onmouseout="this.style.backgroundColor='#FFFFFF" onclick="window.location='otherpage.php'">Text in row</td>
</tr>[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.