Template:Floated box/doc

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Lua error in Module:TNT at line 159: Missing JsonConfig extension; Cannot load https://commons.wikimedia.org/wiki/Data:I18n/Uses TemplateStyles.tab. Use this template if you want a non-quotation to be styled as a quote box. Do not use this template for actual quotations! It does not output <blockquote>...</blockquote> tags.

Parameters

[edit source]
1
The text in the box.
left
If yes is specified, the box becomes left-floated.
class
Additional classes for the box, e.g. specifying noprint will hide the box if you print the page.
width
Custom width for the box (in any CSS unit).
bottommargin, topmargin, leftmargin, rightmargin
Custom margins for the box (in any CSS units). bottommargin - bottom margin of the box, topmargin - top margin of the box, etc.
float
If none is specified, the box isn't floated.

Examples

[edit source]

This template defaults to being right-floated:

{{floated box|1=This is example text with default alignment.}}

This is example text with default alignment.

It becomes left-floated if you specify |left=yes:

{{floated box|1=This is example text in a left-aligned box.|left=yes}}

This is example text in a left-aligned box.

You can also remove the alignment completely if you specify |float=none (don't forget |leftmargin=0):

{{floated box|1=This is example text in a non-aligned box.|float=none|leftmargin=0}}

This is example text in a non-aligned box.

Custom width can be specified using the |width= parameter:

{{floated box|1=This is example text with default alignment and 50% width.|width=50%}}

This is example text with default alignment and 50% width.

Note that none of the above applies to mobile devices (i.e. viewports smaller than 640px wide).

Custom margins can be specified using the |bottommargin=, |topmargin=, |leftmargin= and |rightmargin= parameters:

{{floated box|1=This is example text with default alignment, 50% width and custom margins.|width=50%|bottommargin=2em|topmargin=2em|leftmargin=4em|rightmargin=4em}}

This is example text with default alignment, 50% width and custom margins.

Additional classes can be specified using the |class= parameter, e.g. |class=noprint will hide the box when a page is printed:

{{floated box|1=This is example text you can't see when you print the page ([https://en.wikipedia.org/w/index.php?title=Special:DownloadAsPdf&page=Template%3AFloated_box%2Fdoc&action=show-download-screen try it]).|class=noprint}}

This is example text you can't see when you print the page (try it).