Template:Notice/doc: Difference between revisions

Content added Content deleted
Line 10: Line 10:
===Optional parameters ===
===Optional parameters ===


The box can be titled with an optional {{para|heading}} (or {{para|header}} or {{para|title}}). This is centered by default. This:<br />
The box can be titled with an optional {{para|heading}} (or {{para|header}} or {{para|title}}). This is left-aligned by default. This:<br />
{{in5}}<code><nowiki>{{Notice |heading=Heading |Lorem ipsum dolor sit amet...}}</nowiki></code>
{{in5}}<code><nowiki>{{Notice |heading=Heading |Lorem ipsum dolor sit amet...}}</nowiki></code>
produces an all-left notice:
produces an all-left notice:
{{Notice|demospace=main |heading=Heading |style=margin-bottom:2.0em; |[[Lorem ipsum|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]}}
{{Notice|demospace=main |heading=Heading |style=margin-bottom:2.0em; |[[Lorem ipsum|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]}}


It can be hard to notice a short heading on a wide monitor when it is centered. It can be moved to the left with {{para|left|y}}. This:<br />
It can be hard to notice or read short heading and/or message on a wide monitor when they centered. For long content, it can be centered with {{para|center|y}}. This:<br />
{{in5}}<code><nowiki>{{Notice |heading=Heading |left=y |Lorem ipsum dolor sit amet...}}</nowiki></code>
{{in5}}<code><nowiki>{{Notice |heading=Heading |center=y |Lorem ipsum dolor sit amet...}}</nowiki></code>
produces an all-left notice:
produces an all-centered notice:
{{Notice|demospace=main |heading=Heading |style=margin-bottom:2.0em; |left=y |[[Lorem ipsum|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]}}
{{Notice|demospace=main |heading=Heading |style=margin-bottom:2.0em; |center=y |[[Lorem ipsum|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]}}


The parameter {{para|style|text-align:center;}} can be added to center the text below the heading (which is the left by default). This:<br />
The parameter {{para|textstyle}} can be used to pass arbitrary inline CSS to the main note content. For example, one could center the just the text below a left-aligned heading; this:<br />
{{in5}}<code><nowiki>{{Notice |heading=Heading |style=text-align:center; |Lorem ipsum dolor sit amet...}}</nowiki></code>
{{in5}}<code><nowiki>{{Notice |heading=Heading |textstyle=text-align:center; |Lorem ipsum dolor sit amet...}}</nowiki></code>
produces an all-centered notice:
produces an all-centered notice:
{{Notice|demospace=main |heading=Heading |style=text-align:center;margin-bottom:2.0em; |[[Lorem ipsum|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]}}
{{Notice|demospace=main |heading=Heading |style=margin-bottom:2.0em; |textstyle=text-align:center;|[[Lorem ipsum|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]}}

Similarly, the parameter {{para|headstyle}} can be used to pass arbitrary inline CSS to the heading content. For example, one could center the just the heading above a left-aligned message; this:<br />
{{in5}}<code><nowiki>{{Notice |heading=Heading |headstyle=text-align:center; |Lorem ipsum dolor sit amet...}}</nowiki></code>
produces an all-centered notice:
{{Notice|demospace=main |heading=Heading |style=margin-bottom:2.0em; |headstyle=text-align:center;|[[Lorem ipsum|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.]]}}



The message box can also take an {{para|image}} parameter (with a value of just the bare filename of the image, without <code>File:...</code>, <code>Image:...</code>, or markup), but this is discouraged in articles. For an example of its use, see below.
The message box can also take an {{para|image}} parameter (with a value of just the bare filename of the image, without <code>File:...</code>, <code>Image:...</code>, or markup), but this is discouraged in articles. For an example of its use, see below.