Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS a:link not working in browsers

Status
Not open for further replies.

worldly1

Technical User
Mar 20, 2007
36
US
Hello all,

Every time I have tied to add the a:link pseudo class to a page, it affects the links in design view correctly (according to the style I've applied to the a:link) but it never shows up when I preview in Firefox or IE. This happens regardless of whether the a:link is in a document specific CSS file or external. My a:hover styles work fine. Seems like I'm missing something basic.

Any help would be much appreciated. Thank you, Scott
 
Without seeing your CSS code, I can only guess that maybe your a.style, a.hover are in the wrong order. a.link should always be first, in the CSS declarations. and Hover should always be last. With visited and Active in between.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Well, maybe that's my problem. I have only a:link and a:hover styles in my CSS (in that order). Do I need to have all 4? And what is a:style?

I'll experiment and see what I can learn.

Thanks,

Scott
 
Yup, that did it.

I needed an a:visited between my link and hover - twist and shout.

Thanks for the help

Scott
 
This is the actual order:
Code:
a:link {color: #FF0000}     /* unvisited link */
a:visited {color: #00FF00}  /* visited link */
a:hover {color: #FF00FF}   /* mouse over link */
a:active {color: #0000FF}   /* selected link */
LoVe HAte is an often used mnemonic to remember the order in the stylesheet.

You do not need all 4, so apparently that is not the problem here. What do you get if you view online or if you just open the html file with a browser?

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Thanks Greg,

Love/hate I can remember.

Scott
 
Of course, my posting came after you had already solved the problem. Glad you found it.

Greg
"Personally, I am always ready to learn, although I do not always like being taught." - Winston Churchill
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top