Difference between revisions of "Template:Warning"

From PINE64
Jump to navigation Jump to search
(Proper fix, template was not found)
(Try fix the new line problem)
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<table cellspacing="0" cellpadding="0" border="0" style="box-sizing:border-box; border:1px #d33 solid; background: transparent; margin-top:0.5em;padding:0.5em;background-color: #fee7e6"><tr><td nowrap="nowrap" valign="top"><span style="position: relative; top: -2px;">[[File:OOjs_UI_icon_notice-destructive.svg|18px|<!--T:1--> Warning|link=]]</span> '''<!--T:2--> Warning:'''</td><td valign="top" style="padding: 0 0.5em 0 0.5em;">{{{msg|{{{1|}}}}}}</td></tr></table>
<noinclude>
{{Template}}
 
A waring box for highlighting dangerous actions and security warnings. It starts with "'''Warning:'''" by default.
 
== Usage ==
 
<nowiki>{{Warning|warning content}}</nowiki>
 
== Example ==
 
<nowiki>{{Warning|This is a warning.}}</nowiki>
 
{{Warning|This is a warning.}}
 
== Technical notes ==
 
The boxes use <code>display: table</code> to support both adaptive width and floating siblings, all other alternatives can't archive them as perfect as this solution within just one HTML element. However, it has its own flaw, if you put it into another table, its padding will gone. Avoid putting hints, notes and warnings into any tables until solution was found, or we give up and use two elements for just one box.
 
This template uses class <code>.template-box</code> and <code>.template-warning</code>.
In the future, if the [https://www.mediawiki.org/wiki/Extension:TemplateStyles TemplateStyles Extension] is installed on this MediaWiki instance,
one may move the embedded inline styles to Template Style files.
 
== See also ==
 
* [https://wiki.archlinux.org/title/Template:Warning ArchWiki: Template:Warning]: the template on which this one is based on
* [[Template:Hint]]
* [[Template:Note]]
</noinclude><includeonly><div role="note" class="template-box" style="
display: table;
min-width: 16em;
min-height: 1.6em;
margin: .5em 0 1em;
padding: .5em 1em;
border: 1px solid #d33;
color: black;
background-color: #fee7e6;
"><strong>Warning:</strong> {{{1|}}}</div></includeonly>

Revision as of 22:47, 7 October 2021

This page is a template. Check out all pages using this template.
For more information, read Template:Template.

A waring box for highlighting dangerous actions and security warnings. It starts with "Warning:" by default.

Usage

{{Warning|warning content}}

Example

{{Warning|This is a warning.}}
Warning: This is a warning.

Technical notes

The boxes use display: table to support both adaptive width and floating siblings, all other alternatives can't archive them as perfect as this solution within just one HTML element. However, it has its own flaw, if you put it into another table, its padding will gone. Avoid putting hints, notes and warnings into any tables until solution was found, or we give up and use two elements for just one box.

This template uses class .template-box and .template-warning. In the future, if the TemplateStyles Extension is installed on this MediaWiki instance, one may move the embedded inline styles to Template Style files.

See also