PDA

View Full Version : Need help with Hover code


i have no name
11-24-2004, 12:59 PM
I am currently using the colour change to a darker brown as my hover effect for me www.gamestudiosanan.net.tf website. But I have changed my mind, I wanted to change the hove to only underline.

I have tried doing it, but it only works for unvisited links. I want it to work for all links. Please help!

If you want to see the code then it can be found here. (I didn't upload the pictures).

RysChwith
11-24-2004, 01:38 PM
CSS for links must be declared in the following order: link, visited, hover, active. You have visited declared after hover, which is causing your problem.

Rys

i have no name
11-24-2004, 02:25 PM
Thanks, I have tried it, but it still does not work.

eRad
11-24-2004, 03:08 PM
your web site source still has them in the wrong order, you don't specify an underline for hover anyway, and i don't see a point in setting the text-decoration for Visited as none... it's redundant

i have no name
11-24-2004, 04:20 PM
I didn't actually upload the updated file. I edited it on my computer and it stays the same.

RysChwith
11-24-2004, 04:36 PM
Remove the link, alink, and vlink attributes from the <body> tag. Then make sure your CSS matches this:

a:link { color: #FFCC00;
text-decoration: none }

a:hover { text-decoration: underline }

If that doesn't work for you, post the current file and we'll take another look at it.

Rys

Pegasus
11-24-2004, 04:56 PM
Rys, if you don't include all the elements for the links, then it can get messed up in some browsers.

a.link {css: information; }
a.visited {css: information; }
a.hover {css: information; }
a.active {css: information; }

Even if there's no change between the different sections (you can just repeat the information), you still have to have all four elements.

i have no name
11-24-2004, 05:37 PM
OK I have updated and uploaded the file, it still doesn't seem to work though.

i have no name
11-25-2004, 11:47 AM
Can someone please help?

RysChwith
11-25-2004, 04:20 PM
Thanks, Peg. My mistake.

Where you have this in the head of the file:

<style>
<!--
a:link { text-decoration: none }
a:hover { text-decoration: none; color: #FFFF00 }
a:visited { text-decoration: none }
-->
</style>

you need to change it to this:

<style>
<!--
a:link { color: #FFCC00;
text-decoration: none }
a:visited { color: #FFCC00;
text-decoration: none }
a:hover { color: #FFFF00;
text-decoration: underline }
a:active { color: #FFFF00;
text-decoration: underline }

You also need to get rid of everything in red here:

<body bgcolor="#773E13" link="#FFCC00" vlink="#FFCC00" alink="#FFCC00">

Take care of those, and your problem should be solved.

Rys

i have no name
11-26-2004, 05:13 AM
Thanks for the information and help. I will try it later. I am at school right now.