Difference between revisions of "Template:Warning"
Jump to navigation
Jump to search
(Add more technical notes) |
(Fix) |
||
Line 31: | Line 31: | ||
</noinclude><includeonly> | </noinclude><includeonly> | ||
<!-- --> | <!-- --> | ||
<div role="note" class="template-box | <div role="note" class="template-box" style=" | ||
display: table; | display: table; | ||
min-width: 16em; | min-width: 16em; | ||
Line 40: | Line 40: | ||
color: black; | color: black; | ||
background-color: #fee7e6; | background-color: #fee7e6; | ||
">{{{1|}}}</div> | "><strong>Warning:</strong> {{{1|}}}</div> | ||
<!-- --> | <!-- --> | ||
</includeonly> | </includeonly> |
Revision as of 11:30, 22 September 2021
This page is a template. Check out all pages using this template.
For more information, read Template: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
- ArchWiki: Template:Warning: the template on which this one is based on
- Template:Hint
- Template:Note