Page 1 of 1
a question about a page i use css with
Posted: Tue Dec 16, 2003 8:27 pm
by dull1554
i'm trying to code a php menu system, i wanted to use css to make the table cells change color on hover, heres what i have
Code: Select all
#MAINMENU {
BACKGROUND-COLOR : #808080;
}
#SECONDARYMENU {
BACKGROUND-COLOR : #C0C0C0;
}
and this is what i tried but it failed horriably!!!!!!!!!
Code: Select all
#MAINMENU {
BACKGROUND-COLOR : #808080;
}
#MAINMENU:hover {
BACKGROUND-COLOR : #C0C0C0;
}
#SECONDARYMENU {
BACKGROUND-COLOR : #C0C0C0;
}
#SECONDARYMENU:HOVER {
BACKGROUND-COLOR : #808080;
}
is it just that you can't change table bgcolor on:hover?
is there a different way of doing this?????
Posted: Tue Dec 16, 2003 8:32 pm
by microthick
The only browser that supports td:hover currently is Mozilla.
If you want some nice css examples to work from, check this out.
http://css.maxdesign.com.au/listamatic/
Posted: Tue Dec 16, 2003 8:34 pm
by dull1554
thanks
Posted: Tue Dec 16, 2003 8:37 pm
by dull1554
is there any way in which i could create some sort of a element inside my <td> that i could pass the hover thingy(for lack of better words to describe it) to so i still get a similar effect?
Posted: Tue Dec 16, 2003 8:41 pm
by Paddy
Are rollovers out of the question in your situation?
Posted: Tue Dec 16, 2003 8:42 pm
by microthick
Using JavaScript, you can change the bg color of table cells.
But if you're only using css, you can only change the bg color of links, using a:hover.
Posted: Tue Dec 16, 2003 8:44 pm
by DuFF
Yes, I've done it before with Javascript. It's pretty easy, just customize this example:
Heres an example:
Code: Select all
<td bgcolor="#808080" onMouseOver="style.backgroundColor='#C0C0C0'; style.cursor='hand'" onMouseOut="style.backgroundColor='#808080';" width="150">
Posted: Tue Dec 16, 2003 8:46 pm
by dull1554
paddy you mean a rollover image? i could do that but i want to keep it as fast as possiable, and images slow page load......., how might one do it with js, js i dont have a clue about
Posted: Tue Dec 16, 2003 8:54 pm
by Paddy
DuFF wrote:Yes, I've done it before with Javascript. It's pretty easy, just customize this example:
Heres an example:
Code: Select all
<td bgcolor="#808080" onMouseOver="style.backgroundColor='#C0C0C0'; style.cursor='hand'" onMouseOut="style.backgroundColor='#808080';" width="150">
That one just went in my code snippet file.
Cheers Duff.

Posted: Tue Dec 16, 2003 8:57 pm
by dull1554
sorry duff poster just before i so i did not see his post, thanks, i got it, i went out on my own and i'm using this
Code: Select all
<td onMouseover="this.bgColor='#CFCFCF'"onMouseout="this.bgColor='transparent'">