PDA

View Full Version : Footer and links change colour when clicked.


Crumpy1
04-21-2012, 11:01 AM
Hi All,

My footer contains 5 links all text based stored in a <ul>. When you hover over the links they change colour as per the css which is what i want, however when you click the link the whole footer changes colour to match the hovered over link colour.

My CSS for the whole footer is here

#footer {
position: relative;
border: 2px solid #b7b771;
background-color: #f4f1ee;
clear: both;
width: 1260px;
float: right;
}
#footer ul {
margin-left: 130px;
font-size: 90%;
}
#footer ul li {
display: inline;
margin-right: 50px;
}
#footer a:link, #footer a:visited {
color: #333;
text-decoration: none;
font-size: 100%;
padding: 5px;
}
#footer a:hover, #footer a:focus, #footer:active {
text-decoration: none;
color: #000;
background-color: #cc9;
}

I do not what anything to happen to the background of the footer when the links are clicked.

Here is my half finsished homepage to see what i mean http://hfcc.0catch.com/, if you click anywhere in the footer off a link and it will change to a light brown colour.

Hope that made sense, Thanks ALL!

Corrosive
04-22-2012, 07:38 AM
#footer a:hover, #footer a:focus, #footer:active {
text-decoration: none;
color: #000;
background-color: #cc9;
}

You've missed the anchor reference out of the above. Try;

#footer a:hover, #footer a:focus, #footer a:active {
text-decoration: none;
color: #000;
background-color: #cc9;
}

Crumpy1
04-22-2012, 03:10 PM
Your a legend!! Yes that worked perfectly, i have spent ages going over and over this css but missed that everytime.

Cheers

Corrosive
04-23-2012, 07:46 AM
Your a legend!!

And in my own lifetime as well ;)

domedia
04-23-2012, 12:52 PM
Your a legend!!

He must be, because that is not the first time he's been called with those very words :-D