Template:Pre2/doc: Difference between revisions

From Zoophilia Wiki
Jump to navigationJump to search
meta>Unused0029
(add more text in example usage)
meta>Unused0029
m (change ambox content - this a work in progress)
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. -->


{{ambox|type=notice|text=I think work on this template should be on hiatus for a bit; if you think you'd find the template useful, you can [[User talk:Drum guy|talk with me]], but I doubt anyone will really miss it for now. [[User:Drum guy|Drum guy]] ([[User talk:Drum guy|talk]]) 20:34, 13 June 2008 (UTC)}}
{{ambox|type=notice|text=This is a work in progress --[[User:Drum guy|Drum guy]] ([[User talk:Drum guy|talk]])}}




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


==Coding==
==Coding==

Revision as of 20:42, 13 June 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. 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.

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