Template:Clear: Difference between revisions
No edit summary |
HiddenDragon (talk | contribs) (Added documentation template, category) |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
<includeonly><div style="clear: both; {{#if: {{{1|}}} | height: {{{1}}}px; }}"></div></includeonly><noinclude> | <includeonly><div style="clear: {{#if: {{{left|}}} | left | {{#if: {{{right|}}} | right | both}} }}; {{#if: {{{1|}}} | height: {{{1}}}px; }}"></div></includeonly><noinclude>{{Documentation|content= | ||
Use this template at the end of an article section to make sure that images or other media don't flow over to the next section. Blank space will be added to the section to ensure this. | Use this template at the end of an article section to make sure that images or other media don't flow over to the next section. Blank space will be added to the section to ensure this. | ||
Example: | Example: | ||
{{Template demo | |||
< | | style = list | ||
| <nowiki> | |||
=== Some section === | === Some section === | ||
Line 16: | Line 17: | ||
Blah blah blah. | Blah blah blah. | ||
</ | </nowiki> | ||
}} | |||
In this example, there will be some blank space below the text "Some text that isn't very long" to ensure that the header "The next section" appears after the bottom of Some_image.jpg is reached. If <code><nowiki>{{clear}}</nowiki></code> wasn't used, the header of the next section would appear right after the text of the previous section, and it wouldn't be clear what section the image belongs to. | In this example, there will be some blank space below the text "Some text that isn't very long" to ensure that the header "The next section" appears after the bottom of Some_image.jpg is reached. If <code><nowiki>{{clear}}</nowiki></code> wasn't used, the header of the next section would appear right after the text of the previous section, and it wouldn't be clear what section the image belongs to. | ||
Line 27: | Line 29: | ||
{{clear|20}} | {{clear|20}} | ||
</pre> | </pre> | ||
}} | |||
[[Category:Templates]] | |||
</noinclude> | </noinclude> |
Latest revision as of 10:03, 19 January 2025
Use this template at the end of an article section to make sure that images or other media don't flow over to the next section. Blank space will be added to the section to ensure this.
Example:
=== Some section === [[File:Some_image.jpg|thumb|right|200px|Look at this nice image at the right side of the page.]] Some text that isn't very long. {{clear}} === The next section === Blah blah blah.Renders as
Some section
Some text that isn't very long.
The next section
Blah blah blah.
In this example, there will be some blank space below the text "Some text that isn't very long" to ensure that the header "The next section" appears after the bottom of Some_image.jpg is reached. If {{clear}}
wasn't used, the header of the next section would appear right after the text of the previous section, and it wouldn't be clear what section the image belongs to.
Note that this isn't always necessary or desired; sometimes it doesn't matter that much whether it's clear which section an image is in, or the image only slightly cuts into the next section which looks less bad than the blank space that would be caused by this template. Choose freely whether to use it or not depending on what you think looks nicer and clearer for the reader.
A parameter can be provided for extra blank space (in pixels):
{{clear|20}}