Template:-: Difference between revisions
(Created page with "<includeonly><div style="clear:{{{1|both}}}"></div></includeonly><noinclude>{{doc}}") |
No edit summary |
||
Line 1: | Line 1: | ||
<includeonly><div style="clear:{{{1|both}}}"></div></includeonly><noinclude>{{doc}} | <includeonly><div style="clear:{{{1|both}}}"></div></includeonly><noinclude>{{doc}} | ||
[[Category:Templates]] | |||
[[Category:Universal]] | |||
</noinclude> |
Latest revision as of 19:19, 1 March 2024
The template adds the following code to the page: <div style="clear:left/right/both;"></div>
(the value after clear
depends on the parameters). This code affects elements with the CSS property float
, including files floated to the side (for example, [[File:Image.png|right]]
).
Usage
- To clear both sides of the page, add the code
{{Clear}}
. - To clear only the left side of the page, add the code
{{Clear|left}}
. - To clear only the right side of the page, add the code
{{Clear|right}}
.
You can also use {{-}}
instead of {{Clear}}
as a shorthand call for this template.
Example
=== Section 1 === [[File:CandidateFace BernieSanders.png|200px|right]] Section 1 text. === Section 2 === Section 2 text. {{Clear|right}} === Section 3 === Section 3 text.
This code produces the following result:
Section 1
Section 1 text.
Section 2
Section 2 text.
Section 3
Section 3 text.
As you can see above, the image of the Skullgirls logo added in section 1 is displayed to the right and extends down through section 2, while the {{Clear}}
template is called at the end of the second section, resulting in the logo image not being next to section 3. Thus, one use of the {{Clear}}
template is to control which elements are displayed next to which other elements.
See also
This documentation is automatically transcluded from Template:-/Documentation and is not included when this page is transcluded.