[pmwiki-users] Image Captions

Hans Bracker design at softflow.uk
Fri Oct 31 10:32:15 PDT 2025


rfloat and lfloat are css classes injected into the HTML header via 
PmWiki's wikistyles.php script, like:

.lfloat{float:left; margin-right:1%;}
.rfloat{float:right; margin-left:1%;}

I would use float and not align, as that is what you try to do, so the 
subsequent text will flow around the image. To make sure the width style 
is only applied to the container and not the image as well, you could 
use  adiv wrapper, like:

>>float=right width=33pct margin=3pct p70i<<
[[Attach:test-03.jpg|Attach:test-03.jpg"Here you can read the tooltip text!"]]| This is a fine picture!
>><<
followed by your text paragraph(s).

You could use rfloat insted of float=right.

Or, alternatively, you could define your own css classes (in 
pub/css/local.css for instance). As an example:

/* right-float with 33% width and some margin */ .rfloat33 {float:right; 
width:33%; margin:2%; padding:5px;}

and then use that in the wikistyle markup, like:

%rfloat33 p70i%[[Attach:test-03.jpg|Attach:test-03.jpg"Here you can read the tooltip text!"]]| This is a fine picture!
and followed by your text...

The amber skin has got a file grid.css with  a number of positioning 
shorthand classes defined, created to help with responsive grid layouts.

Hope this may help a bit.

cheers,
Hans


On 31/10/2025 12:43, Martin Cuno wrote:
> Hi everyone!
>
> I frequently position images on websites and have become accustomed to doing so with the following specifications, e.g.: %align=right width=33pct hspace=3pct vspace=3pct p70i%
>
> For a while, I used "rfloat" and "lfloat" instead of "align," but I couldn't get it to work. Even now, I see that the position and size are incorrect. I found this confirmed here:https://www.pmwiki.org/wiki/PmWiki/Images-Talk (see: Why doesn't pct specification work in conjunction with lfloat?). Is there any clarification on this? While testing, I got the impression that it stops working above a certain image size (file size or pixels!).
>
> I would like to be able to insert captions using the syntax shown: "|This is the caption" appended to the image specifications. But this only works with rfloat/lfloat, and then the other settings are no longer correct.
>
> I'd prefer to stick with "align" because my websites are full of it. But how can I get captions?
>
> The problem is visible on my test page:https://www.edition-lgc.de/i.php?n=Sandbox.Testseite0001
>
> Does anyone know a simple solution that I can easily use in my daily work?
>
> Thanks!
>
> Martin
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20251031/dfdb2527/attachment.html>


More information about the pmwiki-users mailing list