Template:Pre2/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Unused0029
m (change ambox content - this a work in progress)
meta>Unused0029
(update content and trim)
Line 4: Line 4:
{{ambox|type=notice|text=This is a work in progress --[[User:Drum guy|Drum guy]] ([[User talk:Drum guy|talk]])}}
{{ambox|type=notice|text=This is a work in progress --[[User:Drum guy|Drum guy]] ([[User talk:Drum guy|talk]])}}


 
This template uses [[HTML element#Other containers|<nowiki><pre></nowiki>]] 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.
 
This template simply uses [[HTML element#Other containers|<nowiki><pre></nowiki>]] tags, but with [[word wrap|wrapped text]]. This means the text will not stretch past the right side of the screen.


==Usage==
==Usage==
 
===Wrapped text===
{{tlx|Pre2|Text to be displayed. And more and more and more...}}
<nowiki>{{Pre2|Text to be displayed. And more and more and more...}}</nowiki>
:produces:
: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 more and more and more and more and more and more and more.}}
{{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 more and more and more and more and more and more and more.}}


==Coding==
===Scrollbox===
 
<nowiki>{{Pre2|type=scroll|Text to be displayed. And more and more and more...}}</nowiki>
The template contains:
:produces:
 
{{Pre2|type=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 more and more and more and more and more and more and more.}}
<pre><nowiki>
<pre style="
white-space: -moz-pre-wrap;
white-space: -pre-wrap;
white-space: -o-pre-wrap;
white-space: pre-wrap;
word-wrap: break-word;
">{{{1}}}&#60;/pre&#62;</nowiki>
</pre>
 
This tells all of the popular browsers to wrap the text. The <code>width=</code> attribute is now deprecated, so <nowiki><pre width=100%></nowiki> will not work in all browsers i.e. Internet Explorer.


==See also==
==See also==
* {{tl|pre}}
* {{tl|pre}}, which mimics <nowiki><pre></nowiki> tags as rendered with the monobook Wikipedia skin.
* [[HTML element#Other containers|<nowiki><pre>…</pre></nowiki>]]
* [[HTML element#Other containers|<nowiki><pre>…</pre></nowiki>]]
* [[Word wrap]]ping
* [[Word wrap]]ping

Revision as of 22:14, 13 June 2008

This template 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.

Usage

Wrapped text

{{Pre2|Text to be displayed. And more and more and more...}}

produces:
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 more and more and more and more and more and more and more.

Scrollbox

{{Pre2|type=scroll|Text to be displayed. And more and more and more...}}

produces:
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 more and more and more and more and more and more and more.

See also