Template:Clear: Difference between revisions

From Vigyanwiki
Template>Willscrlt
(Updated to match current en.wiki version)
m (39 revisions imported from alpha:Template:Clear)
 
(17 intermediate revisions by 12 users not shown)
Line 1: Line 1:
<div style="clear:both;"></div><noinclude>
<div style="clear:{{{1|both}}};"></div><noinclude>
 
{{documentation}}
----
This template outputs <code>&lt;div style="clear:both;"&gt;&lt;/div&gt;</code>, which causes a break to be added between two objects. If there is an image, infobox, or other item floating to the left of the right, the break will extend to the bottom of the floated item. In other words, it will expand until the space is clear on both the left and the right.
 
 
== See also ==
* {{tl|clearleft}} delays content until left column is complete.
* {{tl|clearright}} delays content until right column is complete.
* {{tl|-}} is similar, but technically different.
*: ''The finer points of {{Tl|clear}} vs. {{Tl|-}} are discussed in [[w:Template talk:-#- versus clear|w:Template talk:-]] and [[w:Template talk:Clear]].''
 
 
[[Category:Typing-aid templates|{{PAGENAME}}]]
[[Category:Formatting templates|{{PAGENAME}}]]
</noinclude>
</noinclude>

Latest revision as of 10:13, 8 December 2022

Template documentation

Description

This template makes content wait until existing content is completed in all columns. It is often used to prevent text from flowing next to unrelated images.

Usage

  • {{clear}} — adds <div style="clear:both;"></div>
  • {{clear|left}} — adds <div style="clear:left;"></div>
  • {{clear|right}} — adds <div style="clear:right;"></div>

For technical details, see the discussion in the talk page.

Examples

Example without {{clear}}

HeidelbergTun.jpg

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.

New section without template

Without {{clear}}, this section starts at the right of the image.

Example that uses {{clear}}

HeidelbergTun.jpg

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.


{{clear}}

New section with template

{{clear}} placed before this section, so it appears below the image.

TemplateData

This is the TemplateData documentation for this template used by VisualEditor and other tools.

Clear

[[Category:Templates using TemplateData{{#translation:}}]]

Makes content wait until existing content is completed in all columns. Often used to stop text from flowing next to unrelated images, so text will appear on a full width line under the image.

Template parameters

This template prefers inline formatting of parameters.

ParameterDescriptionTypeStatus
Side1

Can be 'right' or 'left' so content is delayed until just the right or left column is complete. The default clears both columns.

Suggested values
right left both
Lineoptional

See also