Template:Clear

From MozillaWiki
Revision as of 16:21, 28 June 2012 by Kernst (talk | contribs) (A convenience template swiped from Wikipedia's Template:Clear)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

A simple template to clear floats in the page layout.

This can be used, for example, after a left-floated image (e.g., [[File:TheImage.jpg|left]]) within a subheading to left-align the next paragraph. Normally, the paragraph following the float would get "stuck" to the right side of the image, and the float would only get "cleared" by a subsequent subheading or a manual clear.

Usage

To include this template in a page, use the template syntax:

{{clear}}

where the clear is desired on the page. No visible output will be rendered on the page in place of the template.

Clearing either margin (defaults to both) is accomplished with a template parameter as follows:

Clear the left margin (i.e., move all other block-level elements out of the way along the left side of the container element) {{clear|left}}
Clear the right' margin (i.e., move all other block-level elements out of the way along the right side of the container element) {{clear|right}}