By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,967 Members | 1,690 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,967 IT Pros & Developers. It's quick & easy.

a:hover

P: n/a
Hello,

I created some styles applied to <atag.

Everything works fine. However, after I click the link its style
becomes the one which I defined in a:visited. Now, when i place the
mouse over the text color doesn't change as defined in a:hover. The
background changes with no problem.

Could someone tell me what am I doing wrong?

Here is the code:

a, a:link
{
color: #6B254E;
text-decoration: underline;
}
a:active, a:hover, a[name]:hover
{
background-color: #F0D2E3;
color: #6B254E;
text-decoration: none;
}
a:visited
{
color: #606060;
}

Thanks,
Miguel

Sep 22 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
shapper wrote:
Everything works fine. However, after I click the link its style
becomes the one which I defined in a:visited. Now, when i place the
mouse over the text color doesn't change as defined in a:hover. The
background changes with no problem.

Could someone tell me what am I doing wrong?
a:active, a:hover, a[name]:hover
....
a:visited
....

You're defining the color for links that are visited after you define the
color for links that are hovered, if a link is both then the most specific
wins, since they are equally specific the one defined last wins.

--
David Dorward <http://blog.dorward.me.uk/ <http://dorward.me.uk/>
Home is where the ~/.bashrc is
Sep 22 '06 #2

P: n/a
shapper wrote:
Everything works fine. However, after I click the link its style
becomes the one which I defined in a:visited. Now, when i place the
mouse over the text color doesn't change as defined in a:hover. The
background changes with no problem.

Could someone tell me what am I doing wrong?
The CSS needs to be in the order: link, visited, (focus,) hover, active

"Las Vegas Has Animals"

--
-bts
-Motorcycles defy gravity; cars just suck.
Sep 22 '06 #3

P: n/a
Beauregard T. Shagnasty wrote:
shapper wrote:
>Everything works fine. However, after I click the link its style
becomes the one which I defined in a:visited. Now, when i place the
mouse over the text color doesn't change as defined in a:hover. The
background changes with no problem.

Could someone tell me what am I doing wrong?

The CSS needs to be in the order: link, visited, (focus,) hover, active

"Las Vegas Has Animals"
Las Vegas Free Hotel Accommodations.
Sep 23 '06 #4

P: n/a
Harlan Messinger wrote:
Beauregard T. Shagnasty wrote:
>shapper wrote:
>>Everything works fine. However, after I click the link its style
becomes the one which I defined in a:visited. Now, when i place the
mouse over the text color doesn't change as defined in a:hover. The
background changes with no problem.

Could someone tell me what am I doing wrong?

The CSS needs to be in the order: link, visited, (focus,) hover,
active

"Las Vegas Has Animals"
Las Vegas Free Hotel Accommodations.
Heh, that's a good one. They used to be nearly free, but that was long
ago...

--
-bts
-Motorcycles defy gravity; cars just suck.
Sep 23 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.