Difference between revisions of "Template:Float right/doc"

(Doc page)
 
(Cleaned up)
 
Line 3: Line 3:
  
 
===Offset===
 
===Offset===
You can prevent the text from floating all the way to the right through the use of the <tt>offset</tt> parameter:
+
You can prevent the text from floating all the way to the right through the use of the <tt>right</tt> parameter:
  
<nowiki>{{float right|'''This text is floated right with no offset.'''}}</nowiki>
+
<nowiki>{{float right|'''This text is floated right with no offset.'''}}</nowiki>
 
yields
 
yields
{{float right|'''This text is floated right with no offset.'''}}{{-}}
+
{{float right|'''This text is floated right with no offset.'''}}
 
but
 
but
<nowiki>{{float right|offset=3em|'''This text is floated right with an offset of 3em.'''}}</nowiki>
+
<nowiki>{{float right|'''This text is floated right with an offset of 3em.'''|3em}}</nowiki>
 
yields
 
yields
{{float right|offset=3em|'''This text is floated right with an offset of 3em.'''}}{{-}}
+
{{float right|'''This text is floated right with an offset of 3em.'''|3em}}
  
 
== Parameters ==
 
== Parameters ==
 
* 1st {{parameter|text}}
 
* 1st {{parameter|text}}
* 2nd {{parameter|''o''}} the same effect as the <code>offset=</code> parameter
+
* 2nd {{parameter|''right''}} sets the margin to the right of the floated text to the designated amount.
* 3rd {{parameter|''x''}} sets the top and bottom margin of floated text to the designated amount
+
* 3rd {{parameter|''top''}} sets the top and bottom margin of floated text to the designated amount
* 4th {{parameter|''y''}} sets the margin (gap) to the left of the floated text to the designated amount.
+
* 4th {{parameter|''left''}} sets the margin to the left of the floated text to the designated amount.
  
The distance parameters must ''include'' a unit (e.g. <code>2em</code>, unlike in {{tl|float left}} where a unit of <code>em</code> is assumed.
+
The distance parameters must ''include'' a unit (e.g. <code>2px</code> or <code>3em</code>).
  
 
{| class="prettytable" width="100%" cellpadding="20"
 
{| class="prettytable" width="100%" cellpadding="20"

Latest revision as of 10:50, 25 July 2013

Usage[edit]

This template floats text to the right.

Offset[edit]

You can prevent the text from floating all the way to the right through the use of the right parameter:

{{float right|'''This text is floated right with no offset.'''}}

yields This text is floated right with no offset. but

{{float right|'''This text is floated right with an offset of 3em.'''|3em}}

yields This text is floated right with an offset of 3em.

Parameters[edit]

  • 1st {{{text}}}
  • 2nd {{{right}}} sets the margin to the right of the floated text to the designated amount.
  • 3rd {{{top}}} sets the top and bottom margin of floated text to the designated amount
  • 4th {{{left}}} sets the margin to the left of the floated text to the designated amount.

The distance parameters must include a unit (e.g. 2px or 3em).

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

This text is
floated right
using {{float right}}.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

See also[edit]