View Full Version : link color not working correctly...
Twilightrose917
03-05-2008, 03:45 PM
I've got the links set up to where they are red and visited links are purple. (#9900FF) Whenever I preview the page, one link shows up red and the rest blue. And they don't change after being visited. I am using a different browser than I normally do- would that affect it or does it matter?
Medyman
03-06-2008, 12:53 AM
Can you post some code? You're probably just declaring it on one instance.
If you want to make the change site wide (instead of just some select links), add the following to your header (or external CSS file).
<style>
a:link, a:active { color:red; }
a:visited { color:#9900FF; }
a:hover { color:green;}
</style>
rangana
03-06-2008, 05:17 AM
...but not for compliant browsers like FF.
See this code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
#nav a {
color:#f00;
text-decoration:none;
}
ul
{
list-style-type:none;
font-family:Tahoma;
font-size:10pt;
}
</style>
<script type="text/javascript">
window.onload=function()
{
var accept=document.getElementById('nav').getElementsByTagName('a');
for(var start=0;start<accept.length;start++)
{
accept[start].onclick=function()
{
for(var start=0;start<accept.length;start++)
{
accept[start].style.textDecoration='none';
{
this.style.textDecoration='underline';
this.style.color='#9900FF';
}
}
}
}
}
</script>
</head>
<body>
<ul id="nav">
<li><a href="#">navigation one</a></li>
<li><a href="#">navigation two</a></li>
<li><a href="#">navigation three</a></li>
<li><a href="#">navigation four</a></li>
<li><a href="#">navigation five</a></li>
</ul>
</body>
</html>
See if it helps ;)
Medyman
03-06-2008, 05:48 AM
...but not for compliant browsers like FF.
What? Since when are anchor pseudo classes not stanards compliant?
rangana
03-06-2008, 06:02 AM
What? Since when are anchor pseudo classes not stanards compliant?
No, that's not what I mean. I mean that the effects may be well on IE, but not in FF..and maybe in Opera.
I only have FF here to test, but I observed that the active link does'nt work.:rolleyes:
Twilightrose917
03-06-2008, 12:27 PM
I'll try both of them and see which one works better. I'm supposed to put those codes in the <head> section, right? (just checking... idk for sure...)
and thanks for the help. :)
Twilightrose917
03-06-2008, 05:10 PM
I got it to work in IE... and FF... and Safari... but for a random question - why do some things work in some browsers but not in others???
Medyman
03-07-2008, 05:40 PM
I only have FF here to test, but I observed that the active link does'nt work.:rolleyes:
ummm...it 100% works. maybe you did something wrong in your testing.
I got it to work in IE... and FF... and Safari... but for a random question - why do some things work in some browsers but not in others???
To make web coding more exciting. Things COULD work just as you want them to but what's the fun in that. ;)
Or maybe it's because MS choose not to follow web standards. They're coming around though...some stuff was fixed in IE7 and IE8 is looking pretty promising. Of course, this means that the websites we've created for the old browsers with hacks to make IE comply will break....how ironic!
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.