Template:Pre2/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Unused0029
halfway through adding
 
meta>Unused0029
finished (for now)
Line 2: Line 2:
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->
<!-- PLEASE ADD CATEGORIES AND INTERWIKIS AT THE BOTTOM OF THIS PAGE. -->


This template simply uses [[HTML element#Other containers|<nowiki><pre></nowiki>]] tags, but with wrapped text. This means
{{ambox|type=content|text=It would be great if someone who knows about coding templates could try to fix it - as I don't ''think'' it works, or I will get round to it soon. Thanks, [[User:Drum guy|Drum guy]] ([[User talk:Drum guy|talk]]) 20:20, 25 February 2008 (UTC).}}
 
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==


{{tlx|Pre2|''Text to be displayed.''}}
{{tlx|Pre2|Text to be displayed.}}
:produces:
:produces:
::{{Pre2|Text to be displayed.}}
{{Pre2|Text to be displayed.}}
 
If you don't mind cluttering the page with some coding, you can also use <nowiki>{{</nowiki>[[WP:subst|subst]]:Pre2<nowiki>}}</nowiki>. This is particularly useful where another set of <nowiki>{{template}}</nowiki> brackets would be harder to work with than the raw code.


==Coding==
==Coding==


The template contains:
<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}}
* [[HTML element#Other containers|<nowiki><pre>…</pre></nowiki>]]
* [[HTML element#Other containers|<nowiki><pre>…</pre></nowiki>]]
* [[Word wrap]]ping


<includeonly><!--
<includeonly><!--
++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, THANK YOU. -->
++++ PLEASE ADD CATEGORIES AND INTERWIKIS BELOW THIS LINE, THANK YOU. -->
</includeonly>
</includeonly>

Revision as of 20:20, 25 February 2008

This template simply uses <pre> tags, but with wrapped text. This means the text will not stretch past the right side of the screen.

Usage

{{Pre2|Text to be displayed.}}

produces:
Text to be displayed.

If you don't mind cluttering the page with some coding, you can also use {{subst:Pre2}}. This is particularly useful where another set of {{template}} brackets would be harder to work with than the raw code.

Coding

The template contains:

<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}}}</pre>

This tells all of the popular browsers to wrap the text. The width= attribute is now deprecated, so <pre width=100%> will not work in all browsers i.e. Internet Explorer.

See also