Click to See Complete Forum and Search --> : CSS help needed!!!


jjudge
03-19-2003, 10:10 AM
I am having a problem with a hover in my CSS file. It works for some text and dose mot work for others ? ?
Here is my CSS code.
Thanks James

BODY, TD, TH, A, P,H1,H2,H3{
font-family : "Helvetica", "Arial", "MS Sans Serif", sans-serif;font-size : 8.5pt;
}

**************************************************
//recognises this code and makes the text white !

.jmenu, .clsNode:visited{
cursor: hand;
color: white;
font-weight : bold;
font-size : 8.5pt;
text-decoration : none;
}

**************************************************
//dose not recognise this code an dose not make the text yellow when I hover over it ? ?

.jmenu:hover{
cursor: hand;
color: yellow;
font-weight : bold;
font-size : 8.5pt;
text-decoration : underline;
}
**************************************************
//recognises this code

.clsNode, .clsNode:visited{
color: white;
font-weight : bold;;
font-size : 8.5pt;
text-decoration : none;
}

**************************************************
//recognises this code

.clsNode:hover{
color: yellow;
font-weight : bold;;
font-size : 8.5pt;
text-decoration : underline;
}

DaiWelsh
03-19-2003, 10:13 AM
What html entities are you using the two classes on? I believe the pseudo-classes :hover et al only apply to <a href> and wont have any effect if applied to other entities?

jjudge
03-19-2003, 10:26 AM
I am using javascript window.open for some of the links and href for the others??
the javascript links are the ones that will not recognise the hover!!
Is there anything i can do about this??

Thanks,
James.

Vladdy
03-19-2003, 10:28 AM
Originally posted by DaiWelsh
What html entities are you using the two classes on? I believe the pseudo-classes :hover et al only apply to <a href> and wont have any effect if applied to other entities?

True for stoopid IE 'cause arrogant M$ would not comply with the specs they helped develop. In Gecko browsers hover pseudo-class will work with other elements as it should.

DaiWelsh
03-19-2003, 11:03 AM
Originally posted by jjudge
I am using javascript window.open for some of the links and href for the others??
the javascript links are the ones that will not recognise the hover!!
Is there anything i can do about this??


Did you have an href for your anchor or did you just have onclick? e.g.

<a onClick="window.open.........">Bad News</a>

If so try adding an href e.g.

<a href="#" onClick="window.open.........">Bad News</a>

Also, if you dont want the page to jump to the top when you click it be sure to return false at the end of the onClick e.g.

<a href="#" onClick="window.open.........;return false;">Bad News</a>

so that the browser does not folow the link to "#" which will probably just jump to the top of the current page.

@Vladdy, lol did not know it was IE only that had this restriction, but cant say I am shocked. :p

HTH,

Dai