[pmwiki-users] Help creating a custom style?

Jonathan Smith jon at readingroom.com.au
Wed Jan 26 00:44:27 CST 2005


At 11:25 AM 26/01/2005, Patrick R. Michaud wrote:
>On Tue, Jan 25, 2005 at 05:35:03PM +1100, Jonathan Smith wrote:
> > Hello
> >
> > I'd like to make a custom style that defines a width and font-style
> > attribute.
> >
> > I've tried:
> >
> > $WikiStyle['pagequote']['width'] = '400';
> > $WikiStyle['pagequote']['font-style'] = 'italic';
> >
> > in both the config and wikistyle.php files but no luck.
> >
> > Only the font-style attribute gets displayed. I feel like the answer may
> > lie in the wikistylecss[] but I don't understand it.
>
>Unfortunately "width" is one of those strange attributes that occurs
>both in CSS and HTML.  At the moment (and for historical reasons)
>PmWiki chooses to use it to be able to produce width='...'
>attributes in <img> tags, which makes it difficult to also use it
>for <span> styling.
>
>At the moment I don't have a good permanent solution to this problem,
>and I can totally understand how this would be desirable or useful.
>
>In the meantime, a good (and safe) workaround is to use CSS classes
>directly rather than trying to program the $WikiStyle array.
>Instead of setting $WikiStyle['pagequote'] -- just use
>
>    $HTMLStylesFmt['pagequote'] =
>      " .pagequote { width:400; font-style:italic; }\n";
>
>and %pagequote% will then generate <span class='pagequote'>
>which will do what you want.
>
>Pm

Hi Patrick

Thanks very much for for the reply. My question has now expanded a little 
as I've realised that some attributes I need to use only work on block 
level elements.

Is there a way of defining a style that will get applied to a <p> tag 
instead of a <span>? I understand the following example will work when 
placed in the content


%block text-align=right% The text of this paragraph is
right-aligned.

but what is the equivalent in the wikistyles.php file?

Many thanks

Jonathan Smith


-------------- next part --------------
An HTML attachment was scrubbed...
URL: /pipermail/pmwiki-users/attachments/20050126/8e4108bb/attachment.html 


More information about the pmwiki-users mailing list