Dunkel_Teufel Posted March 26, 2006 Share Posted March 26, 2006 GreetingsI am new at using XHTML and I was testing some pages that I converted recently when i realized that some CSS do not work with it. Mainly the CSS that are for the links <a>.I attach here the CSS code, maybe I have to change something on it or it is a problem with the code that I did not realized.<style type="text/css">a:hover {text-decoration:none; background-color:C7C7C7;}a:link {text-decoration:none; color:gray;}a:active {text-decoration:none; color:gray;}a:visited {text-decoration:none; color:gray;}</style>ThanxEnrick DT.HS! Link to comment Share on other sites More sharing options...
Jonas Posted March 26, 2006 Share Posted March 26, 2006 I can tell you one thing. If you're going to use hex colors, you need to use the # sign to tell the browser that this is a hexadecimal color. So your color would be like this:#D7D7D7That's the only error I see. There could be a problem with gray/grey, but I think both spellings are ok (american/uk-english). Link to comment Share on other sites More sharing options...
boen_robot Posted March 26, 2006 Share Posted March 26, 2006 The order of the pseudo classes is wrong. It must be exactly like this to work: a:link {text-decoration:none; color:gray;}a:visited {text-decoration:none; color:gray;}a:hover {text-decoration:none; background-color:#C7C7C7;}a:active {text-decoration:none; color:gray;} That's why I prefer not to use the :link pseudo class. You can't go wrong with it.[edit] I think so Jonas... That's why as I said, I prefer not to use it .[/edit] Link to comment Share on other sites More sharing options...
Jonas Posted March 26, 2006 Share Posted March 26, 2006 Lol. Never used a:link in my life. Doesn't a simple a { } do the same thing? Link to comment Share on other sites More sharing options...
Dunkel_Teufel Posted March 26, 2006 Author Share Posted March 26, 2006 The order of the pseudo classes is wrong. It must be exactly like this to work:a:link {text-decoration:none; color:gray;}a:visited {text-decoration:none; color:gray;}a:hover {text-decoration:none; background-color:#C7C7C7;}a:active {text-decoration:none; color:gray;} That's why I prefer not to use the :link pseudo class. You can't go wrong with it. Hey thanx for the help. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now