Log in

View Full Version : hover link (simple) nvm - solved.



james438
08-24-2007, 04:30 PM
Hi, how do you get the link to be red when you hover over the link and green when you don't hover over the link whether you have visited the link or not?

I am using:
<style type="text/css">
a:link {
color:red;
}
a:hover {
color: #ffcc33;
}
a:visited {
color:purple;
}</style>

EDIT: Fixed. I looked through the forums and discovered that order is more important than I thought when dealing with CSS. The code should have looked like this:
<style type="text/css">
a:link {
color:red;
}
a:visited {
color:purple;
}
a:hover {
color: #ffcc33;
}</style>

Sliight
08-24-2007, 04:38 PM
Hi, how do you get the link to be red when you hover over the link and green when you don't hover over the link whether you have visited the link or not?

I am using:
<style type="text/css">
a:link {
color:red;
}
a:hover {
color: #ffcc33;
}
a:visited {
color:red;
}</style>

Just make the a:link and a:visited the same color... then the hover will be the only thing that can change it

james438
08-24-2007, 04:53 PM
That is not true. At least it is not true in Opera, FF, or IE7. Here is a link to the thread (http://www.dynamicdrive.com/forums/showthread.php?t=10756) where I found the answer.