Problem with :active link not changing colors

My page is here:

the first link is “HOME” which is that file you see there. The active link as you see on that page there, the “HOME” link is not changing colors as I have it written in the CSS sheet. Any ideas as to why?

EDIT: Fixed link, sorry about that typo!

Hi Lilyrain,

First, your link is “broken” (probably just a typo) is should be:

I visited the page and looked at your style sheet. Using FIrefox 1.5, page behaves as described in the stylesheet. Remember that you will soo no change in the “active” link until you click on it.

When I click on it, it changes color from the hover to the defined “active” value.

Were you, rather, trying to have the “current” link (the link for the page you are on) display in a different color?


I am going to have like 40 pages plus like this. And I don’t want to have to edit the header of links for each pattern (such as taking the current page link and manually changing the color).

I want the person to know what page they are on. I am unsure of how to code the CSS links in the external file sheet to reflect this?

When I click the “home” link, it flashes pink, but doesn’t stay pink? How do i make it stay pink so that the person knows what page they are on?

You don’t, at least not solely with CSS. This is outside the scope of what CSS is meant to do.

To do what you’re asking, you’ll need code that checks the page (eg, by parsing the URL or some other means) and sets the appropriate style accordingly. This can be done either server-side, with PHP or Perl or whatever, or client-side via JavaScript.

If your site is currently static HTML, go the JavaScript route. While this is fairly simple to do with a little JavaScript knowledge, it may be difficult for someone who doesn’t have any. You might want to find someone to help you if you don’t want to take the time to learn.

If you want useful replies, ask smart questions.

aha… no wonder. I don’t have any javascript knowledge. I will go look to see if I can learn how to do this… or maybe someone here could point me in the right direction. I have coded a couple things with javascript, but not from my knowledge. Thank you for the great info though- I didn’t have to sit here for hours tyring to figure this out of what was wrong!

I am not sure if I have the right end of the garden fork but have a look at this site/page and see if the use of CSS classes could help at all.


Opinions are my own views, not DreamHosts’.
I am NOT a DreamHost employee OK!! :@

You act on my advice at your own risk!

Thank you for the info!