Difference between revisions of "Template:Hint"

From PINE64
Jump to navigation Jump to search
(Template hint)
 
(+1)
 
(15 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<noinclude>
<noinclude>
{{Template}}
{{Template}}
A hint box for showing helpful hints.


== Usage ==
== Usage ==


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


{{hint|Include an useful information here}}
== See also ==


</noinclude><includeonly><div role="hint" class="hint" style="padding: 5px 15px; color: #003670; border: 1px solid #9bcdfd; background-color: #d1ecfd; margin-top: 5px; margin-bottom: 5px; display: block; max-width: 80%;">{{{1}}}</div></includeonly>
* [https://wiki.archlinux.org/title/Template:Tip ArchWiki: Template:Tip]: the template on which this one is based on
* [[Template:Note]]
* [[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;
padding: .5em 1em;
border: 1px solid #9bcdfd;
color: #003670;
background-color: #d1ecfd;
">{{{1|}}}</div></includeonly>

Latest revision as of 09:21, 12 April 2022

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

A hint box for showing helpful hints.

Usage

{{Hint|hint content}}

Example

{{Hint|This is an hint.}}
This is an hint.

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

{{Hint|'''Hint:''' This is another hint.}}
Hint: This is another hint.

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