Jump to content

Help with this CSS problem


Eric

Recommended Posts

When you mouse-over some text, it's supposed to change from white to yellow. But in IE is screws up.This works correctly in Mozilla Firefox and Opera.firefoxoperanav8ly.gifBut fails in Internet Explorer, wow what a supprise </sarcasm>IE is known for it's problems >_>ienav9oo.gifHere's the CSS:

.nav1 {	background-color: #9F9F9F;	color: #FFFFFF;	text-align: center;	padding-left: 3px;	padding-right: 3px;}.nav2 {	background-color: #6F6F6F;	color: #FFFFFF;	text-align: center;	padding-left: 3px;	padding-right: 3px;}a:link.navlink,a:visited.navlink,a:active.navlink {	color: #FFFFFF;	text-decoration: none;	background-color: inherit;	font-weight: bold;}a:hover.navlink {	color: #FFFF00;	text-decoration: none;	background-color: inherit;	font-weight: bold;}

Any help?

Link to comment
Share on other sites

just for kicks try replacing background-color: inherit with an actual color. I have my suspicions that IE doesn't recognize it correctly.

I can't really set a background color for obvious reasons (it has to blend in with the color of the box, either .nav1 or .nav2 I used background-color: transparent before but when W3C decided to label a 'warning' to it I switched to inherit
You're not by chance using a Mac are you??? IE 5 for Mac has an inheritance problem for backgrounds on floated objects.

Nope, Windows XP and IE6
Link to comment
Share on other sites

I can't really set a background color for obvious reasons (it has to blend in with the color of the box, either .nav1 or .nav2 I used background-color: transparent before but when W3C decided to label a 'warning' to it I switched to inherit
I meant do it temporarily to see if that solved your problem...that way you know if IE is having troubles with it.Actually if you take out the background-color line all together the background will not change, try that.
Link to comment
Share on other sites

You get a warning then, saying that you have a color with no background-color :)And it did work before when I had a transparent background, but damn W3C warns that nowIs there anything else you could suggest, other than having two sepeate classes (a:hover.navlink1 and a:hover.navlink2) with background colors?All this extra code can make a website run slower >_>

Link to comment
Share on other sites

Sorry can't suggest anything else...I always do that even with the warning...seems stupid to me.Why should I have to define a background-color everytime I use a color or vice versa??? Just because it is standard it does mean it is the most logical way...Not a good attitude I know, but I rarely validate my CSS...XHTML always though. :)

Link to comment
Share on other sites

I don't know if it matters, but I always write:a.class_name:hovernota:hover.class_nameCould make a difference, I dunno know.

Link to comment
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
×
×
  • Create New...