Difference between revisions of "Template:Note"

From PINE64
Jump to navigation Jump to search
(Fix max width, larger min width, add min height)
(test)
 
(7 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{Template}}
{{Template}}
A note box for showing important notes.


== Usage ==
== Usage ==


<pre><nowiki>{{Note|This is an note.}}</nowiki></pre>
<nowiki>{{Note|note content}}</nowiki>
 
== Examples ==
 
<nowiki>{{Note|This is an note.}}</nowiki>
 
{{Note | This is an note.}}
 
For a more flexible usage, it doesn't start with "'''Note:'''" by default,
you may add it manually with <code><nowiki>'''Note:'''</nowiki></code>:
 
<nowiki>{{Note|'''Note:''' This is an note.}}</nowiki>
 
{{Note | '''Note:''' This is an note.}}
 
== 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-note</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.


== Example ==
== See also ==


{{Note|This is an note.}}
* [https://wiki.archlinux.org/title/Template:Note ArchWiki: Template:Note]: the template on which this one is based on
</noinclude><includeonly><div role="note" class="note" style="box-sizing: border-box; width: max-content; min-width: 16em; max-width: 100%; min-height: 2.6em; margin: .5em 0; padding: .5em 1em; border: 1px solid #fde29b; color: #705000; background-color: #fdf1d1;">{{{1|}}}</div></includeonly>
* [[Template:Hint]]
* [[Template:Info]]
* [[Template:Warning]]
</noinclude><includeonly><div role="note" class="template-box template-hint" style="
display: table;
min-width: 16em;
min-height: 1.6em;
margin: .5em 0 1em;
padding: .5em 1em;
border: 1px solid #fc3;
color: #705000;
background-color: #fef6e7;
">{{{1}}}</div></includeonly>

Latest revision as of 08:17, 27 March 2023

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

A note box for showing important notes.

Usage

{{Note|note content}}

Examples

{{Note|This is an note.}}
This is an note.

For a more flexible usage, it doesn't start with "Note:" by default, you may add it manually with '''Note:''':

{{Note|'''Note:''' This is an note.}}
Note: This is an note.

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-note. 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