jbingman Posted September 30, 2007 Share Posted September 30, 2007 I have a style sheet that contains all the normal link attributes (ex. hover, visited). The hover works fine the first time you select the link but doesnt work anytime after. If you go to fresnosar.com you'll see what i mean. Why would it be doing this is there something wrong in my style sheet? /* CSS Document */ body { background:fixed; border:hidden; background-repeat:no-repeat; background-position:center; background-color:#263E50 } table { background-image:url(images/Untitled-2.gif); border:thin #000000; vertical-align:top } th { border-bottom: thin solid #000000 } h6 { text-decoration:none; color:#DCDCDC } h3 { text-decoration: none; color:#DCDCDC } hr { color:#DCDCDC; border: dashed thin } p { color: #DCDCDC; font-size: 14px; line-height:150%; text-align:inherit } a:link { color:#DCDCDC; text-decoration:none; font-size:12px } a:hover { color:#000000; text-decoration:underline } a:visited { color:#DCDCDC; text-decoration:none; font-size:12px } br { line-height:150% } div.img { margin:2px; height:auto; width:auto; text-align:center } p.style1 { font-size:15px; font-weight:bold; color:#DCDCDC } p.style4 { font-size:12px; color:#DCDCDC } span.style1 { font-size:24px; font-weight:bold; color:#DCDCDC } span.style4 {font-size:2px; color:#DCDCDC } ul {font-size:14px; color:#DCDCDC } div.header {background-color: gray; text-align:left } .stylered { font-size: 12px; color: #FF0000; } Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted September 30, 2007 Share Posted September 30, 2007 links in css must be declared in teh followinig order... a a:link a:visited a:hover a:active Quote Link to comment Share on other sites More sharing options...
dbrimlow Posted September 30, 2007 Share Posted September 30, 2007 As TM says, order is crucial. That was your whole problem. But so is proper declaration. Once you declare a:link and a:hover, you MUST also declare a:visited and a:active. Here is the shorthand version assuming visited and active are the same as link and hover (respectively): a:link, a:visited { color:#DCDCDC; text-decoration:none; font-size:12px } a:hover, a:active { color:#000000; text-decoration:underline } The same order, however, STILL applies even if visited and active are not the same as link and hover (respectively): a:link{ color:#DCDCDC; text-decoration:none; font-size:12px } a:visited{ color:##DCCCCC; text-decoration:none; font-size:12px } a:hover{ color:#000000; text-decoration:underline } a:active{ color:#CCCCCC; text-decoration:underline } Quote Link to comment Share on other sites More sharing options...
jbingman Posted September 30, 2007 Author Share Posted September 30, 2007 Oh ok that makes sense i didnt realize order was a big thing. thanks everyone! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.