Jump to content
xisto Community
Sign in to follow this  
contactskn

Onmouseover In <td> How To

Recommended Posts

Dear friends I want to change the background color of a cell on mouse over it. So I would like to know what is the code for the same I mean to say as soon as I take the mouse pointer on the cell its background color should be changed and as soon as the mouse pointer is again moved back then it should be the same as previous.

Share this post


Link to post
Share on other sites

You use this in a css file:

CSStd {	 background: white;	 color: black;}td:hover, td:active, td:focus {	 background: black;	 color: white;}

:hover, :focus and :active ensure compatibility with most browsers. But please, please don't use tables, they are horrible.
Edited by Baniboy (see edit history)

Share this post


Link to post
Share on other sites

:hover should do the trick. Tables have their place but i dropped them long ago for general layout. They are only good now for their intended purpose. Displaying data in a table, not for arranging links etc...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | 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.