[pmwiki-users] Proposed Default Stylesheet (pmwiki.css)
Patrick R. Michaud
pmichaud at pobox.com
Sun Feb 19 12:19:51 CST 2006
On Sun, Feb 19, 2006 at 06:57:52PM +0100, Joachim Durchholz wrote:
> Patrick R. Michaud schrieb:
> >>I'd try to avoid that if at all possible. Using "+" means you have to
> >>revisit a lot of corner cases, such as "<h2> after <h1>", "<h3> after
> >><h1>", ..., "<h6> after <h1>", "<hr> after <h1>"; repeat for <h2>, <h3>
> >>etc. etc. etc. - horror!
> > Why? Seems to me that h1 + p.vspace, h2 + p.vspace, h3 + p.vspace, etc.
> > would be sufficient to cover things.
> What if somebody writes
> You'd want to determine the spacing there, too.
Isn't that likely to be covered by h2 + p.vspace? Or are you
thinking that in this case you'd want the <h3> heading to end
up being closer to the <h2> than a paragraph would normally be?
> The alternative would be to drop the vspace <p>, and use CSS styling
> Why was <p class="vspace"> introduced in PmWiki?
Because HTML is broken. If you put the margins onto the <p>
elements themselves, then it becomes very difficult to get
lists and other block elements to appear adjacent to paragraphs.
For example, from Hans' Cookbook.GeminiSkin page:
* Blue colours
* Sky colours
* Sky-Blue colors
* Sand colours
If the <p> has margins around it, then there will be vertical
space between "Colours" and the list that follows. (There are
other examples of why <p class='vspace'> is really useful --
this is just the most recent.)
AFAICT, the only real way to avoid this is to never use <p> at all.
But then you still need something to be able to provide the
vertical spacing between elements.
> > Ignoring PmWiki for a moment, how would one adjust the heading
> > margins with CSS assuming "normal" HTML semantics -- i.e.,
> > "How HTML Is Supposed To Be Done"?
> > <h1>Heading</h1>
> > <p>Here's my first paragraph</p>
> > <p>Here's my second paragraph</p>
> I happened to come across that question in Hagan's post first, and
> answered it there.
No, you just said "use margins" -- I knew that much already. I was
wanting to know the *exact* margin settings you would use on the
HTML that would allow you to have less vertical space between the
heading and first paragraph than between the two paragraphs.
Hans answered that by using "margin-top:0.5em; margin-bottom:1em" on <p>,
so here's my counter-challenge:
<p>Here's my first paragraph</p>
<p>Here's my second paragraph</p>
I'd like to see the exact CSS that could be used to get a small
vertical space between the <h1> and <p>, a standard vertical
space between each pair of paragraphs, and no vertical space
between the <p>Colours</p> and the unordered list.
More information about the pmwiki-users