barkster Posted March 24, 2006 Share Posted March 24, 2006 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. ThanksWell guess I should have googled first, pretty easy <td bgcolor="#FFFFFF" onmouseover="style.backgroundColor='#84DFC1';" onmouseout="style.backgroundColor='#FFFFFF'"> </td> Quote Link to comment https://forums.phpfreaks.com/topic/5690-highlight-cell-when-hover-over/ Share on other sites More sharing options...
lpxxfaintxx Posted March 24, 2006 Share Posted March 24, 2006 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 Link to comment https://forums.phpfreaks.com/topic/5690-highlight-cell-when-hover-over/#findComment-20378 Share on other sites More sharing options...
moberemk Posted March 24, 2006 Share Posted March 24, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/5690-highlight-cell-when-hover-over/#findComment-20384 Share on other sites More sharing options...
Gast Posted March 25, 2006 Share Posted March 25, 2006 [!--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] Quote Link to comment https://forums.phpfreaks.com/topic/5690-highlight-cell-when-hover-over/#findComment-20525 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.