Adds an invisible HTML object to clear CSS float style.
Code:
<div style="clear:{{#switch:{{{1|}}}|left=left|right=|right|=both}}"></div>
This template is used on these pages.
Usage
{{Clear|alignment}}
- alignment: (Optional, default both) float clearing; can be left, right or both.
Examples
Code
|
Result
|
<div style="float: left; background-color: #5F5">LEFT</div>
<div style="float: right; background-color: #F55; height: 3em">RIGHT</div>
<div style="background-color: #FD5">Cleared</div>
<div style="float: left; background-color: #5F5">LEFT</div>
<div style="float: right; background-color: #F55; height: 3em">RIGHT</div>
{{Clear}}
<div style="background-color: #FD5">Cleared</div>
|
LEFT
RIGHT
Cleared
LEFT
RIGHT
Cleared
|
<div style="float: left; background-color: #5F5">LEFT</div>
<div style="float: right; background-color: #F55; height: 3em">RIGHT</div>
{{Clear|ohhimark}}
<div style="background-color: #FD5">Cleared</div>
|
LEFT
RIGHT
Cleared
|
<div style="float: left; background-color: #5F5">LEFT</div>
<div style="float: right; background-color: #F55; height: 3em">RIGHT</div>
{{Clear|both}}
<div style="background-color: #FD5">Cleared</div>
|
LEFT
RIGHT
Cleared
|
<div style="float: left; background-color: #5F5">LEFT</div>
<div style="float: right; background-color: #F55; height: 3em">RIGHT</div>
{{Clear|left}}
<div style="background-color: #FD5">Cleared</div>
|
LEFT
RIGHT
Cleared
|
<div style="float: left; background-color: #5F5; height: 3em">LEFT</div>
<div style="float: right; background-color: #F55">RIGHT</div>
{{Clear|right}}
<div style="background-color: #FD5">Cleared</div>
|
LEFT
RIGHT
Cleared
|