473,321 Members | 1,778 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

a:hover

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
4 3606
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: LRW | last post by:
Below I'll paste my CSS and the HTML in question. But what's happening is, I'm trying to establish a link behavior for a class that's separate from the normal link class. I've established a: 's...
6
by: Nikolaos Giannopoulos | last post by:
If I have simplified html (I have removed height, weight, alt, etc... attributes to simplify the example) such as: <div id="header"> <a href="blah.html"><img src="img/blah.jpg"></a> </div> ...
12
by: Sander Tekelenburg | last post by:
Trying to make some images disappear on hover (works), and others appear on hover (works not). In tested browsers, this gives the expected result: IMG.disappear {visibility: visible}...
6
by: Michael Rozdoba | last post by:
I've had some trouble getting IE to behave in respect of applying absolute positioning to a span on an a:hover. I can get it to work, but I don't understand why certain code causes it to fail to...
8
by: JLahm | last post by:
I have defined a class for my images called .image that specifies the default border color, width and style. I'd like to be able to have the pseudo elements link, visited and active have one color...
15
by: Robert Mark Bram | last post by:
Hi All! Problem I began with: Netscape/Opera supports hover for different elements, IE only supports hover for <a> and I want to use hover for <td class="menu"> I then found a fix using some...
2
by: skipc | last post by:
I posted a recent message regarding navigating a table using arrow keys. I've got the code for the navigation working. My table contains rows of links (anchors). I can get to a specific link...
24
by: fehays | last post by:
Hello, I'm having a problem with the css hover effect in IE. I have an <a> tag with the following CSS: a.subNavItem { display:block; color:#464645; padding:2px 7px 4px 6px;...
7
by: Cate Archer | last post by:
I want to have a border around an image that changes color when the mouse hovers over it. The following code works perfectly in FireFox but not in Internet Exploiter. The text link changes color...
4
by: Sigilaea | last post by:
My previous post got squashed because m post is too long. Sorry for that: I have an AJAX page with a CSS menu at the top. My problem is the hover functionality stops working after someone clicks...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.