473,386 Members | 1,609 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,386 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 3611
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.