[pmwiki-users] CSS in HTML pages

Joachim Durchholz jo at durchholz.org
Thu Jun 15 16:54:45 CDT 2006


Patrick R. Michaud schrieb:
> Sure, there are at least two easy ways to do it:
> 
> 1.  In pub/css/local.css
> 
>     .indent { margin-left:1.5em; }

I haven't tested this, but the CSS specs say that in cases of identical 
specifity, the later style will win. In PmWiki, this means the 
HTML-based CSS takes priority, i.e. the styles from pmwiki.css will be 
of lower precedence.

Hmm... I'd probably have to reverse the order in the skin: 
<!--HeaderText--> first, then <link rel='stylesheet'...>.

I'm not 100% sure whether all browsers will honor the changed order 
though. They might handle pulled-in CSS differently from inline CSS 
(that would be contrary to the W3C specs as I understand them, but that 
doesn't mean that IE will stick with that interpretation).

> 2.  Create a new $HTMLStylesFmt setting in config.php:
> 
>     $HTMLStylesFmt[] = ' .indent { margin-left:1.5em; } ';

Ah - I didn't know that the 'pmwiki' in $HTMLSTylesFmt['pmwiki'] was 
essentially commentary.

The downside of this solution is that it won't work with skins.


In general, I'm a bit confused about PmWiki's distribution of CSS over 
pmwiki.css and $HTMLStylesFmt. I think $HTMLStylesFmt should cover only 
those things that are part of PmWiki's semantics, i.e.
   code { white-space: nowrap; }
   .vspace { margin-top:1.33em; }
The other settings seem to be mainly for visual appearance, hence I'd 
have expected to find them in pub/skins/pmwiki/pmwiki.css:
   .indent
   .outdent
   a.createlinktext
   a.createlink
   img
   .apprlink
(Some of that visual appearance is important, of course, so there's 
justification to put some of that in $HTMLStyleFmt anyway. But not 
everything, at least IMHO.)

Regards,
Jo




More information about the pmwiki-users mailing list