Difference between revisions of "Template:Scroll box"
(Created page with "== Usage == <div style="border: 1px #ccc solid; padding:1em;"> <code> '''{{scroll box'''<br /> '''|width='''''<span style="color:blue">width (in pixel or in percent)...") |
|||
Line 1: | Line 1: | ||
− | + | {{Documentation subpage}} | |
− | < | + | <!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE --> |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | {{tl|{{PAGENAME}}}} uses <code>[[HTML element#Other containers|<pre>]]</code> tags, but with text that is either [[word wrap|wrapped]] or is contained in a horizontal scrollbox. This means the text will not stretch past the right side of the screen. | |
− | <span style="color: | + | As it uses real <pre> tags (unlike {{tl|pre}}), it will be displayed correctly regardless of how the user's Wikipedia [[WP:SKIN|skin]] renders <pre> boxes. |
− | : | + | |
− | <span style=" | + | If you want to disable [[WP:Wikitext|wikitext]] in it, you should use <nowiki> tags inside the template (see [[#wikitext|below]]). |
− | : | + | |
− | <span style="color:green | + | ==Usage== |
− | : | + | ===Wrapped text=== |
+ | <span style="background-color:white"><code><nowiki>{{Pre2|Text to be displayed. And more and more and more... and a paragraph break.</nowiki> | ||
+ | <p> | ||
+ | <nowiki>And then more and more...}}</nowiki></code></span> | ||
+ | :produces: | ||
+ | {{Pre2|Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break. | ||
+ | |||
+ | And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.}} | ||
+ | |||
+ | ===Scrollbox=== | ||
+ | <span style="background:white"><code><nowiki>{{Pre2|scroll|Text to be displayed. And more and more and more... and a paragraph break.</nowiki> | ||
+ | <p> | ||
+ | <nowiki>And then more and more...}}</nowiki></code></span> | ||
+ | :produces: | ||
+ | {{Pre2|scroll|Text to be displayed. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break. | ||
+ | |||
+ | And then more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more.}} | ||
+ | |||
+ | ===Style=== | ||
+ | When the text contains links is better to change the text color, thus highlighting: | ||
+ | |||
+ | <span style="background:black"><code><nowiki>{{Pre2|style=color:green|Text to be [[Hyperlink|link]]. WARNING! A{{=}}B, you must use Template:=. And more and more and more... and a paragraph break.</nowiki> | ||
+ | <p> | ||
+ | <nowiki>And then more and more...}}</nowiki></code></span> | ||
+ | :produces: | ||
+ | {{Pre2|style=color:green|Text to be [[Hyperlink|link]]. WARNING! A{{=}}B, you must use Template:{{=}}. And more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and more and a paragraph break.}} | ||
+ | |||
+ | ==Using wikitext {{anchor|wikitext}}== | ||
+ | |||
+ | To disable [[WP:Wikitext|wikitext]] (e.g. <nowiki>[[</nowiki>[[WP:Wikilink|links]]<nowiki>]]</nowiki>), <nowiki> tags must be used in the form: | ||
+ | |||
+ | <span style="background:white"><code><nowiki>{{Pre2|<nowiki>Your [[text]]{{dn|name=Pre2}}, which ''might'' include {{tl|templates}}.<noinclude>[[Category:Examples]]</noinclude></nowiki>}}</nowiki></code></span> | ||
+ | |||
+ | This will produce this: | ||
+ | {{Pre2|<nowiki>Your [[text]]{{dn|name=Pre2}}, which ''might'' include {{tl|templates}}.<noinclude>[[Category:Examples]]</noinclude></nowiki>}} | ||
+ | |||
+ | as opposed to: | ||
+ | {{Pre2|Your [[text]]{{dn|name=Pre2}}, which ''might'' include {{tl|templates}}.<noinclude>[[Category:Examples]]</noinclude>}} | ||
+ | |||
+ | ==See also== | ||
+ | * {{tl|pre}}, which mimics <pre> tags as rendered with the monobook Wikipedia skin | ||
+ | * [[HTML element#Other block elements|<nowiki><pre>…</pre></nowiki>]] | ||
+ | * [[Word wrap]]ping | ||
+ | |||
+ | <includeonly> | ||
+ | {{#ifeq:{{SUBPAGENAME}}|sandbox | | | ||
+ | <!-- CATEGORIES HERE, THANKS --> | ||
+ | [[Category:Programming typing-aid templates]] | ||
+ | [[Category:Wikipedia XHTML tag-replacing templates]] | ||
+ | }} | ||
+ | </includeonly> |
Latest revision as of 00:53, 11 December 2017
Template:Documentation subpage
Template:Tl uses <pre>
tags, but with text that is either wrapped or is contained in a horizontal scrollbox. This means the text will not stretch past the right side of the screen.
As it uses real <pre> tags (unlike Template:Tl), it will be displayed correctly regardless of how the user's Wikipedia skin renders <pre> boxes.
If you want to disable wikitext in it, you should use <nowiki> tags inside the template (see below).
Contents
[hide]Usage
Wrapped text
{{Pre2|Text to be displayed. And more and more and more... and a paragraph break.
And then more and more...}}</code></span>
- produces:
Template:Pre2
Scrollbox
<code>{{Pre2|scroll|Text to be displayed. And more and more and more... and a paragraph break.
<p>
And then more and more...}}</code>
- produces:
Style
When the text contains links is better to change the text color, thus highlighting:
<code>{{Pre2|style=color:green|Text to be [[Hyperlink|link]]. WARNING! A{{=}}B, you must use Template:=. And more and more and more... and a paragraph break.
<p>
And then more and more...}}</code>
- produces:
Using wikitext Template:Anchor
To disable wikitext (e.g. [[links]]), <nowiki> tags must be used in the form:
<code>{{Pre2|<nowiki>Your [[text]]{{dn|name=Pre2}}, which ''might'' include {{tl|templates}}.<noinclude>[[Category:Examples]]</noinclude></nowiki>}}</code>
This will produce this:
Template:Pre2
as opposed to:
Template:Pre2
See also
- Template:Tl, which mimics <pre> tags as rendered with the monobook Wikipedia skin
- <pre>…</pre>
- Word wrapping