Template:Notice

Revision as of 19:26, 29 May 2025 by TheRoman (talk | contribs) (Changed asterisk in "Prevent Dismissal" section to a superscript number.)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Description

This template is a parent template that helps build Notice Templates. It is not intended to be used on its own, but rather to be used to help build other derivative templates.

Usage

Text Only
The only required parameter for this template is text=, which will populate the template with your input.
You Type You Get
{{notice|text=This is a notice.}}
×
This is a notice.
Add a Bold Header
You have the option to also add a bold header by passing header=.

Note: If you wish for the regular text to be bold, surround your text= input with triple apostrophes. ('''INPUT''')
You Type You Get
{{notice
|header=This is a header.
|text=This is the regular text.
}}
×
This is a header.
This is the regular text.
Adjust Width
By default, the width of the notice will be 65% the width of the page or container where it is used. You can adjust this value by passing width= and defining the width as either a percentage (preferred), e.g., 80%, or a pixel width, e.g., 300px.
You Type You Get
{{notice
|text=This notice's width is 100%.
|width=100%
}}
×
This notice's width is 100%.
×
This notice's width is 50%.
Adjust Alignment
By default, the notice will be centered on the page or within the container where it is used. You can adjust its alignment by passing align= with either the value LEFT or RIGHT.
You Type You Get
{{notice
|text=A left/right aligned notice.
|align=LEFT/RIGHT
}}
×
A left aligned notice.
×
A right aligned notice.
Adjust Color
By default, the notice will have a light gray background with a gray border. You can adjust its background color by passing color= with a color value in one of three forms:
1. A Named HTML Color (e.g., red)
2. A hex color code (e.g., #ff0000)
3. An RGB/RGBA value (e.g., rgb(255, 0, 0))

Adding a value not following one of the forms above will cause the background color to be transparent. Please select a shade of color light enough that the black text remains legible.

Note: By adding a color value, the border is removed.
You Type You Get
{{notice
|text=A light green notice.
|color=#bdcca1
}}
×
A light green notice.
Add a Border
It is preferred to have notices display without a border, however you can add a border by passing border=. Your input should follow the standard HTML border format of SIZE PATTERN COLOR, e.g., 1px solid blue.

Note: You can find further details on HTML borders here.
You Type You Get
{{notice
|text=A notice with a blue border.
|border=1px solid blue
}}
×
A notice with a blue border.
Prevent Dismissal
By default, notices have an "x" in the top right corner that, if clicked, will make the notice disappear.1 You can pass dismiss=no to hide the "x", preventing the option to hide the notice. To unhide any notices you may have previously dismissed, select "Reset Notices" from the Tools menu in the upper, right hand corner of the page.

1. Only users who are logged in have the ability to dismiss notices. Anonymous users (i.e., not logged in) cannot dismiss notices, regardless if dismiss=no is passed.
You Type You Get
{{notice
|text=This notice is not dismissible.
|dismiss=no
}}
This notice is not dismissible.
Clear Other Elements
On very rare occasions, a notice may overlap with other elements present on the page. You can prevent this by passing clear=yes. This parameter should only be used as a last resort as passing it may give unexpected or undesired results. Instead, try adjusting using the width or alignment parameters or adding a line break between the notice template and the other element(s).
You Type You Get
Without using clear=yes.
{{quote}}{{notice
|text=This notice is not using "clear=yes".
}}
“

A thing someone said. ”

—Who Said It
×
This notice is not using clear=yes.
Using clear=yes.
{{quote}}{{notice
|text=Using "clear=yes".
|clear=yes
}}
“

A thing someone said. ”

—Who Said It
×
Using clear=yes.

Derivative Templates