Template:Img float/doc

Usage
Creates floating image and caption.

Parameters

 * : add css style attributes. If you change font size by percent you should also change line-height. For example if you want font-size to be 80%: | style = font-size: 80%; line-height: 80%;
 * : add text above picture
 * : The file name (without the "File:" prefix) (mandatory parameter)
 * : The file's CSS class (optional)
 * : The width of the image (optional, default 150px)
 * : The alignment of the image on the page ("left", "right" or "center/centre"; default "right")
 * : Polygon shape outline to allow text to wrap closer to the image if the image is not a rectangle (optional, co-ordinates as comma separated pairs)
 * : The image caption (optional). Do not use any  or div-based templates such as smaller block if the template is located in the middle of a paragraph as Mediwiki will add a paragraph break.
 * : The image caption text alignment ("left", "right" or "center"; default "center")
 * : Image alt-text, ie. for mouse-over text box or for use with a screenreader for the visually impaired (required for accessibility)

Because this is a span-based template (to allow it to "float" within paragraphs without breaking the paragraph), it is disallowed to use block formatting (for example center or smaller block) in the captions.

Image in centre without template
Alternatively, don't use a template for this, just insert the image followed by the caption like this:





Polygon shape outlines
If the image is not a rectangle, and you want text to wrap closer to the image, use the parameter. This parameter uses CSS polygon syntax: comma separated pairs of co-ordinates, either given as a percentage (e.g. ).

Note: Pixel values (e.g. ) may appear to work, but they will result in the text being wrapped incorrectly on the mobile interface if the image is scaled to fit the screen (which will happen on most phone screens if the image is wider than about 350px). Therefore, prefer the relative percentage sizes where possible.

Note: this sets the CSS  style, which overrides the margin-box for text-wrapping. This means if you set margins in the parameter, they will be ignored if you also set.

Caution: divs break paragraphs and cause linter errors
This template is a span-based template, which means it can "float" within a paragraph without breaking the surrounding text into two paragraphs.

However this means that you cannot use any div-based formatting within the field.

Break!

Break!