Get ready for BLACK FRIDAY shopping starting in

Forums

This topic is locked

CSS UL

Posted 15 Feb 2005 14:14:19
1
has voted
15 Feb 2005 14:14:19 Greg LeBreck posted:
Probably a lame question but I have never done it before.
I have an unordered list, In the CSS styles I have an image that is black (a:link) and then I have a image that is blue for the mouseover (a:hover). How do I make it so when I click the link the image stays blue for the page it is on. I thought it was a:active but I have had no luck. Here is the css.

#navbar {
margin: 0px;
padding: 0px;
height: 33px;
width: 700px;
}
#navbar ul {
font-family: Geneva, Arial, Helvetica, sans-serif;
text-align: center;
display: inline;
list-style-type: none;
margin: 0px;
padding: 0px;
clear: left;
}
#navbar ul li {
float: left;
padding: 0;
margin: 0;
display: block;
text-align: center;
}
#navbar ul li a:link {
font-family: Geneva, Arial, Helvetica, sans-serif;
height: 33px;
width: 137px;
display: block;
text-decoration: none;
background-image: url(../i/buttons/black.gif);
background-repeat: no-repeat;
color: #FFFFFF;
padding-top: 5px;
font-size: .8em;
}
#navbar ul li a:visited {
font-family: Geneva, Arial, Helvetica, sans-serif;
height: 33px;
width: 137px;
display: block;
text-decoration: none;
background-image: url(../i/buttons/black.gif);
background-repeat: no-repeat;
color: #FFFFFF;
padding-top: 5px;
font-size: .8em;
}

#navbar ul li a:active {
text-decoration: underline;
background-image: url(../i/buttons/blue.gif);
background-repeat: no-repeat;
}
#navbar ul li a:hover {
text-decoration: underline;
background-image: url(../i/buttons/blue.gif);
background-repeat: no-repeat;
}


Edited by - Nix Neon on 15 Feb 2005 14:15:47

Replies

Replied 17 Feb 2005 14:01:48
17 Feb 2005 14:01:48 Stefan P replied:
A:Active should do it, but when you click away from the link it will of course no longer be active, hence the style will revert to the A:Link or A:Visited

Stefan - www.pash.biz

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
DMX | ASP | VBScript | ACCESS | SQL Server | IIS5
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Replied 17 Feb 2005 14:50:48
17 Feb 2005 14:50:48 Simon Martin replied:
Hi Greg
You might find this link helpful
css.maxdesign.com.au/

Everything you ever wondered about styling your lists

Live the life you love
Love the life you live
~ ~ ~ ~ ~ ~ ~
<b>Simon Martin</b> - <i>DMXzone Manager</i>
<font size=1>[ Dreamweaver MX/MX2004 | ASP | SQL | XHTML/CSS | Web Accessibility ] </font id=size1>

Reply to this topic