Template:Float/doc

From MozillaWiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
Edit-copy green.svg
This is a documentation subpage for Template:Float.
It contains usage information, categories and other content that is not part of the original template page.

Usage

{{float}} encloses the entered text (or other element) in <div> tags, and floats the output to the left, or to the right (or not at all).

Parameters

There are 2 parameters, both unnamed, of which 1 is required and 1 is optional.

Syntax

The template's syntax is

  • {{float|custom text/element |float value }}

Required parameter

1

Custom text/element

The text (or other element) you wish to float. The parameter is unnamed, so no parameter name needs to be specified.

Note
  • This parameter must be placed before the 2nd parameter.
  • By default, if no 2nd parameter is specified, the template will float the entered text/element to the right.
Usage
  • {{float|1}}

Optional parameter

2

Float

Specifies the float you want to impose on the text/element in parameter |1. The parameter is unnamed, so no parameter name needs to be specified.

Available values
Value Comments Default value
none No margins
left Right margin: 20 px;
bottom margin: 10 px
right Left margin: 20 px;
bottom margin: 10 px
Green check.png
Notes
  • This parameter must be placed after the 1st parameter.
  • By default, this parameter will be set to the value right.
  • If an invalid value is entered, the template will display an error message.
Usage
  • {{float|1|2}}

Examples

Correct use

Element Float What you type What you see
Text None {{float|This text doesn't float|none}}
This text doesn't float
Left {{float|This text floats to the left|left}}
This text floats to the left
Right {{float|This text floats to the right|right}}
This text floats to the right
Image None {{float|[[File:Idea.png|20px|link=]]|none}}
Idea.png
Left {{float|[[File:Idea.png|20px|link=]]|left}}
Idea.png
Right {{float|[[File:Idea.png|20px|link=]]|right}}
Idea.png

Incorrect use

Float What you type What you see
Any other than
none,
left, or
right
{{float|This text will not be displayed|east}} Error in {{float}}: the float value "east" is invalid.

See also