Forums / Templates, Stylesheets, Page Layout / Can not get link states to work properly (CSS)

Can not get link states to work properly (CSS)

Locked

Views: 1,434

Results 1 to 5 of 5
This thread is locked. New replies are disabled.
1 Dec 2009, 7:17 PM
#1
hcb39 avatar

hcb39

New Zenner

Join Date:
Nov 2009
Posts:
4
Plugin Contributions:
0

Can not get link states to work properly (CSS)

I have been working on this and I'm a bit stumped right now. The links on the left side box are not showing the active status that I've coded.

Here's a link to my site so you can see what I mean:

http://hollibmedia.com/lee-test

When you're on an active page, the link is supposed to stay #FFC, but it reverts back to the green.

/* LINK FORMATTING */
a img {
	border: none; 
	}

a:link {
	color: green;
	text-shadow: 1px 1px #666666; 
	text-decoration: none;
	}
 
a:visited {
	color: #339900;
	text-shadow: 1px 1px #666666; 
	text-decoration: none;
	}

a:hover {
	color: #FFC;
	text-shadow: 1px 1px #666666; 
	}

a:active {
	color: #FFC;
	text-shadow: 1px 1px #666666; 
	}

.leftBoxContainer {
/*	border: 1px solid #ffffff; */
	margin-top: 1.5em;
	}

.sideBoxContent {
	font-size: 2em;
/*	background-color: #ffffff; */
	padding: 0.4em;
	}

.sideBoxContent a:link {
	text-shadow: 1px 1px #666666;
	color: green;
	text-decoration: none;
	}
 
.sideBoxContent a:visited {
	color: #339900;
	text-decoration: none;
	}

.sideBoxContent a:hover {
	color: #FFC;
	}

.sideBoxContent a:active {
	color: #FFC;
	}

Also, when I took the shadow effect out of the regular links (not the .sideBoxContent links), just part of the links retained the shadow effect and I'm not sure why.

Any help that can be given would be greatly appreciated! If any more information is needed, please let me know.

~HB

1 Dec 2009, 7:49 PM
#2
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: Can not get link states to work properly (CSS)

:active in the selector does not mean the page that is currently being displayed, it means the moment between clicking a link and reloading the page. You will often not see the "active" state at all.

The categories sidebox has coding to apply a different class to the current category and its parent(s), but other sideboxes do not have any means of making the distinction.

1 Dec 2009, 9:02 PM
#3
hcb39 avatar

hcb39

New Zenner

Join Date:
Nov 2009
Posts:
4
Plugin Contributions:
0

Re: Can not get link states to work properly (CSS)

Thank you so much. It's only been 500 years since I've done a website, so I lost my CSS mojo.

Does that mean there is no state that one could use to denote being on a specific page? I do remember hardcoding it before on old sites, but I wasn't sure if there was something I could do in this.

Again, thanks!

HB

3 Dec 2009, 2:52 PM
#4
rstevenson avatar

rstevenson

Totally Zenned

Join Date:
Nov 2006
Location:
Dartmouth, NS Canada
Posts:
2,400
Plugin Contributions:
0

Re: Can not get link states to work properly (CSS)

There's another thread that is in the process of dealing with this issue.

Rob

Breakfast: the most important donut of the day.

3 Dec 2009, 3:32 PM
#5
hcb39 avatar

hcb39

New Zenner

Join Date:
Nov 2009
Posts:
4
Plugin Contributions:
0

Re: Can not get link states to work properly (CSS)

Thank you for that. I'm feeling so overwhelmed and I don't even know where to start with all of that. For as much as I do know and understand, I need someone to break it down a bit more for me. I'll check out that thread and hopefully get something from it. Thanks again for the link.

HCB