[Pmwiki-users] spacer
J. Meijer
commentgg
Tue Jul 6 17:43:21 CDT 2004
When positioning graphic elements on a page, often the result is kind of a
surprise. Multiple linebreaks also often do not have the desired result.
With this construct laying out elements vertically becomes more predictable:
[[spacer: 100px white]]
This should insert a spacer with approximately 100px free space above it.
The 'white' sets the color to make the spacer invisible on a white
background. Pmw2 will probably make it possible to omit the color parameter.
Using the <hr> tag I have found the implementation below totally predictable
in IE6, proving the validity of the idea. But the Mozilla browsers don't
respond well, as usual. Why?
Maybe using another html-element gives better control, f.e. <div>, perhaps
through the line-height attribute. Maybe style-sheets can hide the <hr>
element without specifying a color. Suggestions are very much welcome.
The code given below contains two versions, select the one you prefer (that
should be the [100px] version ;-) and insert it in your local/confg.php.
Note that I didn't strive to pass html-validation tests. Goodluck.
Thought: the -> syntax might accept an indent specifier? Example: ->100px.
-jm
ps In the mean time I modified my wiki to make the background color
accessible, so I now use the neat [100px] form using modified code.
# enable [[spacer:100px]] or [[spacer:100px color]] spacers
$InlineReplacements['/\[\[spacer[: ] ?(\\d+px)\\s?(none|aqua|black|blue|'.
'fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal'.
'|white|yellow|#[0-9a-fA-F]{3,6})?\]\]/']=
'<hr noshade size=0 style="margin-top:$1; color:$2; " >';
# enable [100px] or [100px color] to insert vertical space
$InlineReplacements['/\[(\\d+px)(?: (none|aqua|black|blue|'
.'fuchsia|gray|green|lime|maroon|navy|olive|purple|red|silver|teal|'.
'white|yellow|#[0-9a-fA-F]{3,6}))?\]/']=
'<hr noshade size=0 style="margin-top:$1; color:$2; " >';
---------------------------------------
I'm just a poor man with a wiki
More information about the pmwiki-users
mailing list