SimpleDude
asked on
Change font color on mouseover
Hello!
I've a table that changes the background color when mouseover, and goes back to the original color when mouseout:
<td width="20%" style="cursor:pointer;curs or:hand" onMouseover="this.bgColor= '#2E3740'" onMouseout="this.bgColor=' #ffffff'"> <div align="center">CHANNELS</d iv></td>
What I need to do is also to change the Font color at mouseover (to FFFFFF) and back to #2E3740' when mouseout.
Need some help :)
Thanks!
I've a table that changes the background color when mouseover, and goes back to the original color when mouseout:
<td width="20%" style="cursor:pointer;curs
What I need to do is also to change the Font color at mouseover (to FFFFFF) and back to #2E3740' when mouseout.
Need some help :)
Thanks!
Look at the :hover pseudo-CSS-selector.
You would be much better off doing this in a style sheet. But check this out.
Live Sample for code below http://jsbin.com/zofup/1/
Live Sample for code below http://jsbin.com/zofup/1/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<table>
<tr>
<td width="20%" style="cursor:pointer;cursor:hand" onMouseover="this.bgColor='#2E3740'; this.style.color='#FFFFFF';" onMouseout="this.bgColor='#ffffff'; this.style.color='#2E3740'"><div align="center">CHANNELS</div></td></tr>
</table>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Scott, that's awesome!
Isn't that what I mentioned? : \
ASKER
Sorry Kaufmed, Im new at all these stuff and I used the JavaScript solution instead of the CSS
Thanks.
Thanks.