Live version

Template:Code

<html> <head> <title>...</title> </head> <body>...</body> </html>

Most HTML elements are enclosed between a start tag and an end tag, such as <p>...</p>. Some are not, such as <br>.

Sandbox version

Template:Code/sandbox

<html> <head> <title>...</title> </head> <body>...</body> </html>

Most HTML elements are enclosed between a start tag and an end tag, such as <p>...</p>. Some are not, such as <br>.

Testing sandbox version

Font Size

Fontsize in FF:

Plain
((code))
((code/sandbox))
<code>...</code>
syntaxhighlight
font-family:monospace; only

Markup behaviour

plain ''ABC'' <b>bold</b> <b>bold</b> lang=html ((mdash)) ((PAGENAME))
((code)) plain ''ABC'' <b>bold</b> <b>bold</b> Code/testcases
((code/sandbox)) plain ''ABC'' <b>bold</b> <b>bold</b> Code/testcases
<syntaxhighlight inline> plain ''ABC'' <b>bold</b> <b>bold</b> ((mdash)) ((PAGENAME))
<code><nowiki> plain ''ABC'' <b>bold</b> <b>bold</b> ((mdash)) ((PAGENAME))
<code> plain ABC bold bold Code/testcases
&ndash; &ndash;
lang=something
((code)) &ndash; &ndash;
((code/sandbox)) &ndash;
<syntaxhighlight inline> &ndash; &ndash;
<code><nowiki>
<code>

Misc tests

Sandbox code

Spaces between proportional and monospaced segments are (depending on browser) precisely or very close to precisely the same as the spaces between characters inside the monospaced segment (which are necessarily larger than those between characters in the proportional segments).

Old code

Spaces between proportional and monospaced segments are (depending on browser) farcically smaller than the spaces between characters inside the monospaced segment, making the content weird-looking and hard to parse.

Comparisons

Blow up your font size to twice normal or so, and get out a ruler.

For cases where the padding left or right is undesirable, use |l=n or |r=n (or any other value, like 'no" or "0", with either parameter:

lang tests

Test cases
((code))
((code/sandbox))