Template:Pre2

From Wikipedia, the free encyclopedia

{{{1}}}
[edit] Template documentation


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

[edit] Usage

{{Pre2|Text to be displayed.}}

produces:
{{{1}}}

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 more confusing to work with than the raw code.

[edit] 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.

[edit] See also