Forum OpenACS Q&A: Re: ad_context_bar and link attributes

Posted by Tom Ayles on

You can specify the link, hover and visited pseudo-class attributes as follows:

a:hover { ... }
a:link { ... }
a:visited { ... }

That would set the default behaviour for links with no class. However, what might be more useful is to limit the rules to links within a certain div. So the stylesheet would be like:

div.subsite-context-bar a:hover { ... }
div.subsite-context-bar a:link { ... }
div.subsite-context-bar a:visited { ... }

Then, in the master template, the context bar HTML is already wrapped in a div with class subsite-context-bar (NB: I heard somewhere that some browsers don't like - and _ in class names, though I've never had any trouble myself). This way you can control the styling of only the links in the context bar. This approach might not be rendered properly on older browsers though. To catch these cases then you probably would need somehow to pass a class name into ad_context_bar.