[pmwiki-users] Styling within LI tags

Petko Yotov 5ko at 5ko.fr
Tue Jan 27 05:52:28 CST 2009


On 1/27/2009, "DaveG" <pmwiki at solidgone.com> wrote:

>Is there any way to force a paragraph within an LI element?

>

>I'd like to end up with something like this, but seem to be unable to

>create P tags (which are valid in list elements, unlike DIV tags),



DIV blocks inside list items are valid (X)HTML Transitional.



But yes, I don't know a way to produce them in PmWiki. (Except for the

"vspace" DIV blocks.)



>and

>can't have embedded style % elements:

>   <li class='a'>

>     <p class='b'>text <span class='b1'>b1</span> more</p>

>     <p class='c'>next line</p>

>   </li>



If I needed this, I would define a special span block inside the list

item.



In pub/css/local.css :

  li span.cool {background-color:green; display:block;}

  li span.foobar {background-color:red; display:block;}



In the wiki page :

  # A list item #1



    %cool% Embedded styled paragraph.%%



   %foobar% Another paragraph.%%

  # A list item #2





A downside of this approach is that it is impossible to embed a style in

another style like this :

  %cool% some style %b1% another style %% first style%%



But, you can change the style for bold, italics or teletype formatting

which can be embedded :



in local.css, set em tags to yellow and non-italics :

  li span.cool em { color: yellow; font-style:normal; }



in the wiki page, the word "styled" will be yellow :

  # %cool% Embedded ''styled'' paragraph.%%





Another, possibly easier/simpler solution : emulate list items in

paragraphs instead of in a list :



1. First emulated list item.



%p cool% Some %b1% styled %% paragraph.



2. Second emulated list item.



Thanks,

Petko





More information about the pmwiki-users mailing list