Template:Code

From QED

Jump to: navigation, search


This template makes it easy to produce text boxes that dynamically resize based on the window's width.

Contents

Syntax

{{code|TEXT}}

or: {{code|1=TEXT}}

or: {{code|class=CLASS|style=STYLE|TEXT}}

where:

  • TEXT is the text to be boxed
  • CLASS (optional) is a CSS class
  • STYLE (optional) is a CSS style specification

If TEXT contains any equals signs (=), the second form should be used, or the equals signs should each be replaced by {{eq}}.

If TEXT contains any occurrences of "{{" or "}}", each occurrence of "{{" should be replaced by "{ {" or "{{((}}", and similarly each occurrence of "}}" should be replaced by "} }" or "{{))}}".

Examples

<br>

{{code|Line 1<br>Line2}} produces

Line 1
Line2


Newline

{{code|x {{eq}} y

a {{eq}} b}}
produces

x = y

a = b

Block within <code>

{{code|The expression:
 x<sup>2</sup> - 1
is equal to:
 (x - 1) (x + 1)
}}

produces:

The expression:

x2 - 1

is equal to:

(x - 1) (x + 1)

style

{{code|style=background-color:lightgray|Long text will wrap dynamically depending on the page width. Long text will wrap dynamically depending on the page width. Long text will wrap dynamically depending on the page width.}} produces

Long text will wrap dynamically depending on the page width. Long text will wrap dynamically depending on the page width. Long text will wrap dynamically depending on the page width.

See also

Personal tools