Wespen Posted January 27, 2003 Posted January 27, 2003 Ok the code is <td height="15" onMouseover="this.style.backgroundColor='#CC3333'; " onMouseout="this.style.backgroundColor='#FFFFFF'; "><div align="center" class="fontred" id = "1"> Text</div></td> How can I change font color onMouseOver I tried this.1.style.color = '#FFFFFF'; but nothing Thanks Igor Quote
*Experts* Nerseus Posted January 27, 2003 *Experts* Posted January 27, 2003 Assuming the "1" in "this.1.style..." is the div, I'd use a name that starts with an alpha. Try replacing "1" with "a1" or something. You can also use onMouseover and onMouseout on the div tag to change the foreground color. You could either change the style or the class since your div is already using one. -ner Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Wespen Posted January 27, 2003 Author Posted January 27, 2003 Something like this?? (I added href so DIV is out. I have to change the color of link.) "l1" is ID of a tag. <td height="15" class="borderleft" onMouseover="this.style.backgroundColor='#CC3333'; this.l1.style.class = 'class2'; " onMouseout="this.style.backgroundColor='#FFFFFF'; "><div align="center" > <a href="some.htm" id = "l1" class="class1">text</a></div></td> But this code wont work! Igor Quote
*Experts* Nerseus Posted January 27, 2003 *Experts* Posted January 27, 2003 Ah, if it's a hyperlinke (anchor tag) that you want, simply set the "hover" style of the anchor tag in the stylesheet. Here's a sampe: <html> <style> A:link { COLOR: #FF0000; TEXT-DECORATION: none } A:visited { COLOR: #800000; TEXT-DECORATION: none } A:active { COLOR: #0000FF; TEXT-DECORATION: none } A:hover { COLOR: #FFFF00; TEXT-DECORATION: underline } </style> <body> <table width="100%"> <tr> <td onMouseover="this.style.backgroundColor='#CC3333';" onMouseout="this.style.backgroundColor='#FFFFFF'"> <div align="center"><a href="some.htm">hyperlink test</a></div> </td> </tr> </html> You can also set the alignment on the TD if that's all you're using the DIV for. -nerseus Quote "I want to stand as close to the edge as I can without going over. Out on the edge you see all the kinds of things you can't see from the center." - Kurt Vonnegut
Wespen Posted January 28, 2003 Author Posted January 28, 2003 The problem is that link and cell hover colors are the same When you roll mouse over cell it becomes red, and you have to go a llitle more to go over link. I want to change the link color when I roll over table cell. Thanks Igor Quote
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.