[pmwiki-users] local redefinition of a CSS class

Patrick R. Michaud pmichaud at pobox.com
Fri Aug 3 09:23:38 CDT 2007


On Thu, Aug 02, 2007 at 09:40:52AM +0200, Christophe David wrote:
> Could someone please give an example how to redefine the CSS
> attributes for a class (like 'wikilink') locally ?
> 
> Example: At a given place only, the link [[Main.HomePage|Home]]
> (class='wikilink') should be rendered with text-decoration:none,
> font-size:smaller and color:red .
> 
> I tried to do it with %define=% and (:div style... , but without
> success up to now.

Part of the problem is that the text-decoration can't easily
transfer to the embedded link, because any stylesheet rule selectors
for anchor tags are going to take precedence over the
surrounding span.

I tried enabling "apply=a" and then using:

  %apply=a text-decoration=none color=red% [[Main.HomePage]]

but it still doesn't quite work because of the way the color
attribute has to be forwarded to the <a> tag.  

So, at least in beta63, there doesn't seem to be a way to
do this strictly in wiki markup -- it has to be done using an
external stylesheet or other configuration items.  

I'm inclined to see this as a bug in PmWiki, so I'll see about 
coming up with a fix at some point.

As an external stylesheet (e.g., pub/css/local.css), one could do:

    span.redsmall, span.redsmall a {
      color:red; text-decoration:none; font-size:smaller;
    }

and then in the markup write

    %redsmall% [[Main.HomePage]]

Pm



More information about the pmwiki-users mailing list