The :active pseudo-class is used on the, well, current active element.
In any browser other than IE this doesn't even need to be an anchor:
you could (probably, haven't tested just now) use it on a form element
so that the background changed colour when you were entering
information into an input element (child of the form element, hence
form is still active).

So that's what :active does.

The class="currentlink" solution is probably best... another way to do
it would be to apply a class to body depending on what the current
page was, and use an ID on each of your nav items with the rule

body.documentclass #individualnavitemclass {
font-weight:bold;
}

Personally, I'd prefer to just have the class in the list item itself
(the other seems like overkill, though possibly easier if you're doing
static sites with lots of page-specific styles).

There's probably a way you could parse the href values of each list
item and set the style using JavaScript accordingly, but that's beyond
me at least...

Regards,
Josh

On 1/13/06, Helmut Granda <[EMAIL PROTECTED]> wrote:
>
>
>
> Hello,
>
>
>
> I am trying to show on a left menu what page is currently active with CSS.
> So far the only way I know how to do it is by hand-coding it
>
>
>
> <a href="link.html" class="currentlink">link.html</a>
>
>
>
> What I was thinking about doing was to set up the a:Active class to like
> bold or something, now the only time when the text shows bold is when I
> press on it.
>
>
>
> Is there a way to set up the CSS globally with a:Active or similar so I
> don't have to hand-code each link in my menu?
>
>
>
> Thanks!
>
> -H

--
Joshua Street

http://www.joahua.com/
+61 (0) 425 808 469
******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to