Template:Code
Use this template to write HTML and CSS code. Writing HTML with this template can be useful if you want to add elements that MediaWiki normally would'nt allow you to in the wikitext like <input> or <label>. Additionally, Unlike normal inline styles, this template allows advanced CSS features like functions, media queries, and pseudo-classes.
HTML:
For HTML, enter the URL-encoded code in the html parameter. You can use this simple URL encoding tool
{{code
|html=%3Cinput%20type%3D%22checkbox%22%20id%3D%22checkbox%22%2F%3E%0A%3Clabel%20for%3D%22checkbox%22%3EClick%20Me%3C%2Flabel%3E
}}
The param and param2 parameter allows you to pass parameters inside the URL-encoded html code. An example can be found in Template:cover.
CSS:
For CSS, you can write the styles normally in the css parameter
{{code
|css=body {
color: red;
}
img:hover {
transform: scale(1.03);
filter: brightness(0.85);
}
@media screen and (max-width: 450px) {
html {
font-size: 80%;
}
}
}}
Please note that the code written with this template will take effect after a page has loaded. So if possible, avoid using this template for elements that are at the very top of a page (like InfoBox TV), or else the elements might look weird for a few seconds.