[pmwiki-users] Put a border around an image

Patrick R. Michaud pmichaud at pobox.com
Fri Jan 28 16:43:45 CST 2005


On Fri, Jan 28, 2005 at 11:01:52PM +0100, Thomas -Balu- Walter wrote:
> On Fri, Jan 28, 2005 at 08:59:23AM -0600, Patrick R. Michaud wrote:
> > Unfortunately, in doing so this makes it difficult for PmWiki to add
> > more style= attributes to <img ...> tags because they already have
> > a style attribute.  (I've never seen clear documentation as to whether
> > it's legal for an attribute to be specified multiple times in a single
> > HTML tag, so I've assumed it's not legal.)
> 
> It would be easier if we'd put the img {border: 0px;} inside the
> template-css and not directly into the tag. That way people could
> override the setting in the tag itself. And template admins would have a
> chance to mark all images as they'd like.

I wouldn't mind this so much if we could somehow narrow the selector 
a bit so that we're not affecting "all img tags".  I'm only interested
in affecting the tags that are generated by the wiki markup.  Maybe
<img class='imglink' ... /> is what we really want here.

It's also important to note that at the moment the markup

    %border="1px solid blue"%  Attach:someimg.jpg %%

produces

    <span style='border:1px solid blue'> <img ... /> </span>

and not

    <img style='border:1px solid blue' ... />

The two aren't equivalent, as seen at 
http://www.pmwiki.org/wiki/Test/ImageBorders .

So, we'd have to somehow mark the border attribute as being one
of those attributes that is supposed to be propagated into the <img>
tag itself and not part of the surrounding span.  I'm not sure what
that implies for something like 

    %border="1px solid blue"% Some text Attach:someimg.jpg more text %%

Should "some text" and "more text" also have a border around them?
More generally, do we simply disallow the border attribute for <span>ned
text?   And if we do that for borders, how about margins and padding?

Pm



More information about the pmwiki-users mailing list