Editing Template:-/doc

From Guild of Archivists
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{documentation subpage}}
{{Documentation subpage}}
Shorthand for <code><nowiki><br style="clear: both;" /></nowiki></code>, also see {{tl|clear}}.


<templatedata>
Use {{tl|{{BASEPAGENAME}}}} after any [[float (CSS attribute)|floating element]]s and before elements you do not wish to float together with the first set. This uses a line break, which may introduce an ugly extra blank line. If you want to avoid that, use {{tl|Clear}} instead. Do not use this template to deliberately add whitespace and blank lines between non-floating elements.
 
== Details ==
{{tl|-}} contains the markup:
<pre>
<br style="clear:both;" />
</pre>
This causes any previously established float to clear.
 
Optionally, you can clear only left- or right floating elements by using <code><nowiki>{{-|left}}</nowiki></code> or <code><nowiki>{{-|right}}</nowiki></code>.
 
The unusual name of this template is a [[mnemonic]] for an imaginary horizontal line, which separates floating elements above from those below. Some editors prefer the mnemonic {{tl|Clr}} ("clear"), which simply redirects here. However, do not confuse {{tl|Clr}} with {{tl|Clear}}, which is a different template that uses <code><nowiki><div></div></nowiki></code> instead of <code><nowiki><br /></nowiki></code> and so does not introduce an extra line break.
 
== Examples ==
{{sidebar|navbar=off
| title = Example sidebar
| content1 = In these examples, the {{tl|sidebar}} template is used to create a simple right floating table. For better examples check out the links. Please add missing <tt><nowiki>{{-}}</nowiki></tt> where necessary. This sidebar is only a quick example.
| content2 = {{lorem}}
}}
=== First ===
In the first example <tt><nowiki>{{-}}</nowiki></tt> after the word ''browser'' guarantees that the table does not float into the second example.
* Cute, but less funny if it ''overlaps'' the next table or section, causing horizontal scrolling or worse depending on the browser.{{-}}
{{sidebar|navbar=off
| title = Example sidebar
| content1 = In these examples, the {{tl|sidebar}} template is used to create a simple right floating table. For better examples check out the links. Please add missing <tt><nowiki>{{-}}</nowiki></tt> where necessary. This sidebar is only a quick example.
| content2 = {{lorem}}
}}
----
=== Second ===
In the second example the position of <tt><nowiki>{{-}}</nowiki></tt> is after the word ''but''. Note that it does not affect the
left margin of the bullet '''*''' list, because it is used inside of it.
* Cute, but{{-}}less funny if it ''overlaps'' the next table or section, causing horizontal scrolling or worse depending on the browser.
{{sidebar|navbar=off
| title = Example sidebar
| content1 = In these examples, the {{tl|sidebar}} template is used to create a simple right floating table. For better examples check out the links. Please add missing <tt><nowiki>{{-}}</nowiki></tt> where necessary. This sidebar is only a quick example.
| content2 = {{lorem}}
}}
----
=== Third ===
The third example has a new line after the word ''but'' and <tt><nowiki>{{-}}</nowiki></tt> after the word ''browser''.
* Cute, but
less funny if it ''overlaps'' the next table or section, causing horizontal scrolling or worse depending on the browser.{{-}}
{{sidebar|navbar=off
| title = Example sidebar
| content1 = In these examples, the {{tl|sidebar}} template is used to create a simple right floating table. For better examples check out the links. Please add missing <tt><nowiki>{{-}}</nowiki></tt> where necessary. This sidebar is only a quick example.
| content2 = {{lorem}}
}}
----
=== Fourth ===
The fourth example has <tt><nowiki>{{-}}</nowiki></tt> and a new line after the word ''but''.
* Cute, but{{-}}
less funny if it ''overlaps'' the next table or section, causing horizontal scrolling or worse depending on the browser.
 
== TemplateData ==
{{TemplateDataHeader}}
<TemplateData>
{
{
"description": "Clear floating block-level elements with line break",
        "description": "This template adds the HTML tag 'clear:both' to the page, which clear any previously defined floats. This template has no parameters",
"params": {
        "params": {}
"1": {
"label": "clear",
"description": "CSS clear: left, right, both, none",
"default": "both",
"type": "string"
}
}
}
}
</templatedata>
</TemplateData>
 
== See also ==
* {{tl|Clear left}}: Delays content until left column is complete.
* {{tl|Clear right}}: Delays content until right column is complete.
* {{tl|Clear}}: Delays content until both columns are complete.
* [[Wikipedia:Line-break handling]]


<includeonly>
<includeonly>
[[Category:Formatting templates]]
<!-- ADD CATEGORIES BELOW THIS LINE -->
[[Category:Typing-aid templates]]
[[Category:Wikipedia formatting and function templates|{{PAGENAME}}]]
[[Category:Utility templates]]
</includeonly>
</includeonly>
Please note that all contributions to Guild of Archivists may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see GoArch:Copyrights for details). Do not submit copyrighted work without permission!
Cancel Editing help (opens in new window)