Template:Notice: Difference between revisions

From The Reed and Rite
mNo edit summary
Tag: Manual revert
mNo edit summary
Line 4: Line 4:
   -->{{#switch:{{{align|center}}}|left=margin: 0.3em 0.3em 0.3em 0;|right=margin: 0.3em 0 0.3em auto;|#default=margin: 0.3em auto;}};<!--
   -->{{#switch:{{{align|center}}}|left=margin: 0.3em 0.3em 0.3em 0;|right=margin: 0.3em 0 0.3em auto;|#default=margin: 0.3em auto;}};<!--
   -->padding: 0.5em; text-align: center; font-size: {{{font-size|1em}}}; {{{style}}};<!--
   -->padding: 0.5em; text-align: center; font-size: {{{font-size|1em}}}; {{{style}}};<!--
   -->{{#if: {{{color|}}} | background-color: {{{color}}}; {{#if: {{{border|}}} | border: {{{border}}}; }} | border: 1px solid black; }}">
   -->{{#if: {{{color|}}} | background-color: {{{color}}}; {{#if: {{{border|}}} | border: {{{border}}}; }} | border: 1px solid #A2A7AF; }}">
   <div style="position: relative;"><!--
   <div style="position: relative;"><!--
     -->{{#if:{{{dismiss|}}}|{{#ifeq:{{{dismiss}}}|no||<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}|<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}<!--
     -->{{#if:{{{dismiss|}}}|{{#ifeq:{{{dismiss}}}|no||<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}|<div class="dismiss-button user-only-dismiss" style="position: absolute; top: -1.05rem; right: -0.25rem; cursor: pointer; padding: 5px; font-size: 21px;">×</div>}}<!--
Line 14: Line 14:
The Notice template is a parent template that helps build [[:Category: Notices|Notice Templates]]. This template should never be used in its raw form on an article, but instead should be used to create new templates.
The Notice template is a parent template that helps build [[:Category: Notices|Notice Templates]]. This template should never be used in its raw form on an article, but instead should be used to create new templates.


{{notice|1=Test}}
== Parameters ==
== Parameters ==
{{{style}}} - allows the user to set various style elements of the notice box, like background color
{{{style}}} - allows the user to set various style elements of the notice box, like background color

Revision as of 19:31, 23 April 2025

The Notice template is a parent template that helps build Notice Templates. This template should never be used in its raw form on an article, but instead should be used to create new templates.


×
Test

Parameters

{{{style}}} - allows the user to set various style elements of the notice box, like background color

{{{b}}} - optional parameter that creates a bolded title for the notice box

{{{1}}} - the regular text in the notice box

Examples

Here is one example of a potential notice box.

This code on the template page {{notice|style=background-color:#CCA; |b=This is the bold title of the box! |1=This is the regular text with more detail }}

produces this when the template is used:

×
This is the bold title of the box!
This is the regular text with more detail

Here's another example, this time without the bold line at the top.

This code on the template page {{notice|style=background-color:#FAA; |1=This notice doesn't have a bold title }}


This notice doesn't have a bold title


Use |clear=yes if the notice is interfering with other elements.


×
This is a test
this is also a test


Derived Templates