PDA

View Full Version : CSS CSS Link Colour Help??



- |Flash Man| -
September 3rd, 2008, 09:36 PM
Hey Guys,

I have a small problem:
My problem is that I have some text links as a menu and when it goes to a page I want the link colour of that clicked link to stay RED on the new page it went to and when I click another link I want the first link to go back to it's normal colours. And the new link colour to change to RED and stay RED.

That's what I am having trouble with - all my roll overs and :active, :visited etc.. all work fine I just can't get the above to work dynamically. ( I have alot of pages! ) and the menu is mostly a php include.

Cheers,
George

- |Flash Man| -
September 3rd, 2008, 10:37 PM
http://www.askthecssguy.com/2008/04/prasun_asks_the_css_guy_how_to_1.html

that is exactly what I want to do - but I can't seem to get this one working 100%.

simplistik
September 4th, 2008, 09:30 AM
erm... just apply a class and style based on what page it's on. since it's mostly php use php to detect the page

- |Flash Man| -
September 4th, 2008, 07:01 PM
That's what I would have done simp - but my problem here is the links show and hide divs on the same page. other wise if everything was on a different page I would have done that method you suggested.

This would also work if I could set a variable of i.e. "admin" or "documents" from the link then check the variable and if matched print the class="selected" on my li.

Also I cannot reload the page otherwise my links won't load the swapped divs.
Any ideas for this one??

Thanks Simp,
George