[pmwiki-users] Re: Div Markup + Wiki Styles for Image Placement

H. Fox haganfox at gmail.com
Fri Jul 8 23:14:01 CDT 2005


On 7/8/05, H. Fox <haganfox at gmail.com> wrote:
> On 7/8/05, Patrick R. Michaud <pmichaud at pobox.com> wrote:
> > How did you do it in PmWiki 1?

It turns out I was just doing it with a CSS selector for images in the
wiki body. (See below.)

>  How would one do it in XHTML?

Using the style attribute in the img tag.

<img src="pmwiki.php_files/pmwiki-32.gif" style="border: 0px none ;"
alt="" align="left" >

becomes.

<img src="pmwiki.php_files/pmwiki-32.gif" style="border: 0px none ;
margin-right:12px;" alt="" align="left" >

for example.

Speaking of the style attribute in the <img> tag (style="border: 0px none ;"),

Could the "border: 0px none ;" possibly be moved out of the image
tag's style attribute and  into a selector in the <style> tag in the
headers?

The reason I ask this is because the way it is now it's not easy to
override it and put a border around images.  I often use "border:1px
solid #cccccc;", especially when the image background color might be
the same as the page background color (e.g. screenshots come to mind).

This is not important.  It's another thing I can now work around using
div markup.

> > I often "solved" this problem on my sites by manually adding padding
> > directly into the image files themselves, although I freely admit
> > that's not really a satisfactory solution.
> 
> I can't remember now.  I'll restore a PmWiki 1 wiki and let you know.
> 
> However I was doing it doesn't work in PmWiki 2 though.

Heh.  Turns out it does.

#wikitext img { margin-left:4px; margin-right:12px; margin-bottom:1px;
margin-top:4px; }

combined with %align=right% and %align=right% seems to work nicely in
PmWiki 2.  Those margin values were arrived at through experimentation
in the version 1 wiki.

Hagan




More information about the pmwiki-users mailing list