onmouseover with CSS? (Full Version)

All Forums >> [Web Development] >> Cascading Style Sheets



Message


kt -> onmouseover with CSS? (7/26/2005 11:46:25)

Been hunting around on the forum but haven't found one definitive answer to this:

Part of my current CSS is as follows (I know this is far from great, but only ventured into the world of CCS a couple of weeks ago...)

td.c25 {background-color: #000000; text-align:left; color:#FFFFFF; font-family:Arial,Helvetica,sans-serif,"MS sans serif"; font-size: 11px; line-height:95%}

a.c4 {color: #FFFFFF;}
a:hover.c4{text-decoration:underline; color: #FFFFFF;}


and then a cell on my page is like this:

<td class="c25" onmouseover="this.style.backgroundColor='#2C2C2C';" onmouseout="this.style.backgroundColor='#000000';"><a class="c4" href="login.asp" title="Sign in to your account"><b>sign in</b></a></td>

Is there a way to incorporate the "onmoueover" and "onmouseout" in to the CSS, so that the background colour, not just the link, changes colour?

thanks, kt




Tailslide -> RE: onmouseover with CSS? (7/26/2005 12:12:30)

Here's a tutorial: http://www.cyberstar-designs.com/resorces/css-lessons/css-lesson3-part2.htm




kt -> RE: onmouseover with CSS? (7/26/2005 12:42:56)

thanks tailslide - should be able to make it work with that!

kt




Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.078125