[Pmwiki-users] rendering question about lists (somewhat important)

Reimer Behrends behrends
Mon Feb 2 20:31:24 CST 2004


On Mon, Feb 02, 2004 at 07:40:39PM -0700, Patrick R. Michaud wrote:
> On Mon, Feb 02, 2004 at 08:22:25PM -0500, Reimer Behrends wrote:
> > 
> > I'm not particularly wild about using markup to control layout. Also, I
> > doubt that it can be turned off portably -- you'll require CSS2 features
> > that are not universally supported.
> 
> All I'm doing is adding the following rule to the pmwiki.css
> stylesheet:
> 
> dl, ul, ol, pre { margin-top:0; margin-bottom:0; }
> 
> This may not be universally supported by all browsers, but then
> it wouldn't make a big difference on those browsers anyway.

This should have a net zero effect on the layout (except that lists
following one another will effectively be merged), because the margins
of the paragraph before and after will still result in vertical
whitespace being inserted (a quick local test confirms that). The CSS
box model calculates the bottom margin of the top element and the top
margin of the bottom element, takes the greater of the two values and
inserts that much whitespace. To remove the whitespace between a
paragraph and a list, you have to set the relevant margins of both to
zero. For that, you need at the very least a CSS selector that
matches a sequence of HTML elements (namely, P+OL, etc.).

> > > The advantages:  authors get much greater control over the vertical layout
> > > of items.
> > 
> > Shouldn't that be consistent throughout a site and therefore be defined
> > in a central location (such as the site's CSS file), rather than vary on
> > a case-by-case basis?
> 
> That's what I'm planning to do--it'll be consistent throughout a site
> but a site administrator could choose which interpretation is best.
> All I'm proposing is that PmWiki's default be different from the
> browser default.

The problem with that -- as I understand your proposal -- is that the
layout will vary depending on whether authors insert a blank line
before/after a list. This does not create a consistent layout, because
sometimes they will do one thing and sometimes they will do another
thing. Effectively, layout will be a function of markup rather than
being independent of markup. Please correct me if I misunderstand
something.

> > I am not really sure what it is supposed to accomplish, to be honest.
> > Could you elaborate?
> 
> I'll be glad to elaborate further if this didn't do the trick.  :-)

I think what I'm not getting is why there is a perceived need to
remove the whitespace in the first place.

			Reimer Behrends



More information about the pmwiki-users mailing list