Log in

View Full Version : a:active,hover,link,visited ??



davelf
09-04-2009, 08:45 AM
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<!--
a1a2a7 : grey
19b3ff : blue
-->
<style>
a:visited
{
color:#a1a2a7;
text-decoration:none;
}
a:link
{
color:#a1a2a7;
text-decoration:none;
}
a:hover
{
color:#19b3ff;
font-weight:bold;
}
a:active
{
color:#19b3ff;
text-decoration:none;
}
</style>
</head>

<body>
<h3><a href="#">1</a></h3>
<h3><a href="#">2</a></h3>
<h3><a href="#">3</a></h3>
<h3><a href="#">4</a></h3>
</body>
</html>


what i want:
when the link clicked, the link turn into blue , like when it's hover.

the link like a mess, are there some kind of rules to put the a:active, hover, link, visited. I've already change the position but it still like a mess.

thx for your help..

forum_amnesiac
09-04-2009, 10:53 AM
a:visited
{
color:#19b3ff;
text-decoration:none;

a:hover
{
color:#19b3ff;
font-weight:bold;
}

}

This will give the same font color to the link when it has been visited as to that used during the hover.

davelf
09-04-2009, 11:56 AM
thx for replying, it works, but i have another problem now. When i open again the page, the link color turn into blue permanently. Why don't it back to Grey / normal color like i describe in my style. appreciate:) your help

forum_amnesiac
09-04-2009, 12:08 PM
Once you have visited a page the link will keep the color you have selected for a:visited until you clear out your browser cache/temporary files.

Once this is done then the link will go back to the a:link color

davelf
09-04-2009, 01:48 PM
oow i see, thx a lot for your help...:)