473,406 Members | 2,390 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,406 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 3615
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.