CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   HTML & CSS (http://www.codingforums.com/forumdisplay.php?f=13)
-   -   mouse over (http://www.codingforums.com/showthread.php?t=244)

stevan 06-18-2002 12:32 PM

mouse over
 
i am looking for a script to do a mouse over to change the color of the background and text color in the same cells


Thxs Steve

meerkat 06-18-2002 01:12 PM

Stevan

You could do this quite simply using CSS and the 'a' tag.

#button a {color: white; background-color: red;}
#button a:hover {color: red; background-color: yellow;}


Then you call them up using the div tag:

<div id="button"><a href="#">blah</a></div>

This should work ok

meerkat

QuackHead 06-18-2002 02:50 PM

Are you looking to change the background and text colour when you mouse over a link? Or when you mouse over the cell.

The code meerkat gave you will only change something when the user rolls their mouse over a link inside the <div>

~Quack

Zvona 06-18-2002 02:50 PM

Whenever you're looking for scripts, you should post to forums about scripting problems. Here, we handle and discuss about problems related to mark-up, document structures and style definitions.

In this particular case you were successful: hovering is done with CSS just like stevan advised.
Note, that NN4 don't support pseudo-classes, thus hovering isn't working.

jkd 06-18-2002 05:43 PM

Quote:

Originally posted by QuackHead
The code meerkat gave you will only change something when the user rolls their mouse over a link inside the <div>

Though if everyone finally realized how horrible IE is, we can all go like:

div:hover {
background: bla;
}

Because Gecko, Opera, and I'm pretty sure Konqueror all support the :hover pseudo-class on elements other than <a>. :rolleyes:


All times are GMT +1. The time now is 03:17 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.