PDA

View Full Version : HTML Code Help Please


Stationery-Direct
24th February 2006, 17:46
This is probably really easy, however, I cannot get my head around it today:

If I do not enter a colour for a visited link it defaults to blue, which is nasty and is not in keeping with my site, If I specify a colour then once visited it no longer changes colour on hover, I would still like it to do this.

EG: I want the text to be white, flash black when hover, once the link is visited I want it to stay white and still flash black on hover.

Current code is below any advice is greatly appreciated, thanks in advance

<style type="text/css">
<!--

.style12 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #FFFFFF; }
a:link {
color: #FFFFFF;
}
a:hover {
color: #000000;
}

Coding Monkey
24th February 2006, 17:48
a {
color: #FFF;
text-decoration: none;
}

a:hover {
color: #000;
text-decoration: none;
}


Think that's what you want

Stationery-Direct
24th February 2006, 18:06
Hi Tom

Thanks for that, (2 minutes response time) brilliant.

It works if I dont specify a colour for a visited link, eg. a visited link is blue by default and now flashes to black on hover.
If I specify that visited links must stay white instead of blue the hover stops working.

any ideas?

thanks again

SEOscotland.co.uk
24th February 2006, 18:44
add values for

a:active
a:visited

change a:visited to the same values as a:link

what happens?

Stationery-Direct
24th February 2006, 19:06
Hi there

This is the code at the moment:

.style12 {font-family: Arial, Helvetica, sans-serif; font-size: 14px; color: #FFFFFF; }
a:link {
color: #FFFFFF;
}
a:hover {
color: #000000;
}
a:visited {
color: #FFFFFF;
}

The links stay white and hover black, once visited they stay white and the hover doesn't work anymore, which is what I want it to do.

Any ideas?

Thanks for your help

Stationery-Direct
24th February 2006, 19:07
Sorted now thanks guys

Gary form Creospace pointed out that the hover link must be last in the line in order for it to work.

Thanks for all your help