Template:Code
Appearance
| Template documentation |
|---|
| Note: portions of the template sample may not be visible without values provided. |
| View or edit this template's documentation (edit) (about template documentation). |
No TemplateStyles exist (create). Remember to add after the opening <includeonly> tag:
|
<templatestyles src="Template:Code/styles.css" />
|
Note: Template based off wikipedia:Template:Code and mw:Template:Code
Use {{code|Code to display}}, which results in .
Code to display
Example(s) and usage
[edit source]{{code|code|lang{{=}}css|border:1px solid #fff}} gives:
border:1px solid #fff
Template Data
[edit source]Wraps the content given in {{#tag:syntaxhighlight}} with the enclose="none" attribute and other attributes specified. Used to list some short code, which to stand out, similar to using <nowiki><code></code></nowiki> tags, except that it has a grey background.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| 1 | 1 | Enter the code to display. | String | required |
| 2 | 2 lang text | Enter the language of the code.
| String | optional |
| class | class | Enter valid CSS class(es).
| String | optional |
| style | style | Enter any valid CSS styles, or a string of them separated by semicolons. | String | optional |
| id | id | Enter a valid CSS ID attribute. | String | optional |