Page 1 of 1

a:active question (I think)

Posted: Sun Jan 16, 2011 11:36 pm
by btd
In the page below I have a menu with 3 choices: * Services, * link1, and * link2.
When I click on link 1 or 2 and the page is loaded I expect CSS to display that link in a different color (acitve)
The color is always the same. why?
Is active link the one that caused the page to be displayed?

------------------------------------------------------------------------------------------------------------------------------------
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>test.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

<style type="text/css">
ul#navlist { font-family: sans-serif; }

ul#navlist a
{
font-weight: bold;
text-decoration: none;
}

ul#navlist, ul#navlist ul, ul#navlist li
{
margin: 0px;
padding: 0px;
list-style-type: none;
}

ul#navlist li
{
float: left;
}

ul#navlist li a
{
color: #ffffff;
background-color: #338800;
padding: 3px 7px;
border: 1px #ffffff outset;
}

ul#navlist li a:hover
{
color: #ffff00;
background-color: #003366;
}

ul#navlist li a:active
{
color: #cccccc;
background-color: #003366;
border: 1px #ffffff inset;
}

</style>
</head>

<body>

<div id="navcontainer">
<ul id="navlist">

<li><a href="#" >Services</a></li>
<li><a href="test.html" >link1</a></li>
<li><a href="test1.html">link2</a></li>
</ul>
</div> <!-- end id="navcontainer"> -->
<div id="content">
<h2>Our motto.</h2>
<p> column Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut .</p>
<p>&nbsp;</p>
</div> <!-- end id="content"> -->

</body>
</html>

Re: a:active question (I think)

Posted: Sat Jan 22, 2011 9:02 am
by social_experiment
btd wrote:Is active link the one that caused the page to be displayed?
Yes. The :active pseudo element only works when you click on the link. In what browser are you experiencing this problem?