The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> CSS Link Hovering Issue
nWo Sting
post Feb 25 2007, 09:35 PM
Post #1


Member
***

Group: Members
Posts: 63
Joined: 5-November 06
Member No.: 709



I am having an issue with my CSS and link hovering. I have the text change color when someone mouses over the link as a way to assure them it is a link. I want the hover color to always work, however with CSS when you visit the link, and go back to the original page there is no longer any hover color when you mouse over the link. This is the exact code I am using:

a:link {color: #66CCFF}
a:hover {color: #FF0000}
a:visited {color: #66CCFF}

After you click the link, then the text links no longer change to the hover color when you mouse over, they stay to whatever the visited link color is. I tried removing the visited link code, but a generic visited link color kept showing up. Is there a different code to where text hovering for link always works whether you click the link or not? thanks.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post Feb 26 2007, 03:13 AM
Post #2


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,733
Joined: 9-August 06
Member No.: 6



The order is important. Read here:
http://www.w3.org/TR/REC-CSS2/selector.htm...-pseudo-classes

:link and :visited are mutually exclusive. A link must be either visited or not visited, it can't be both at the same time. That's not the case with :hover. A link can be both visited and hovered at the same time, right? And not visited and hovered. Then the cascade comes into play and decides which declaration that will be applied - in this case that simply means that the last declared one will win out. smile.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
nWo Sting
post Feb 26 2007, 10:29 PM
Post #3


Member
***

Group: Members
Posts: 63
Joined: 5-November 06
Member No.: 709



QUOTE(pandy @ Feb 26 2007, 02:13 AM) *

The order is important. Read here:
http://www.w3.org/TR/REC-CSS2/selector.htm...-pseudo-classes

:link and :visited are mutually exclusive. A link must be either visited or not visited, it can't be both at the same time. That's not the case with :hover. A link can be both visited and hovered at the same time, right? And not visited and hovered. Then the cascade comes into play and decides which declaration that will be applied - in this case that simply means that the last declared one will win out. smile.gif


thanks for the info, I didnt know it worked that way. I will try it out.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
kadricanik
post Mar 6 2007, 10:34 AM
Post #4





Group: Members
Posts: 1
Joined: 6-March 07
Member No.: 2,116



hi.thanks
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 27th April 2024 - 11:23 AM