Template:Notice/doc: Difference between revisions
Content added Content deleted
(ce) |
(→Optional parameters: update) |
||
Line 26: | Line 26: | ||
The box can be titled with an optional {{para|heading}} (or {{para|header}} or {{para|title}}). This is left-aligned 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>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |[[Lorem ipsum|Lorem ipsum]] dolor sit amet...<nowiki>}}</nowiki></code> |
||
produces an all-left notice: |
produces an all-left notice: |
||
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |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 or read short heading and/or message on a wide monitor when they centered. For long content, it can be centered with {{para| |
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|align|center}}.<br />{{small|1=[While {{para|align|right}} is a valid value, it will only be useful when this template is ported to right-to-left language Wikipedias, and shouldn't be used on English Wikipedia or it will be difficult to read.]}}<br /> |
||
This:<br /> |
|||
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |align=center |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
|||
produces: |
|||
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |align=center |Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}} |
|||
A shorthand parameter to center the heading and main text at the same time is {{para|center|y}}. This:<br /> |
|||
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |center=y |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |center=y |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
||
produces |
produces: |
||
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |center=y |
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |center=y |Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}} |
||
The parameter {{para|textstyle}} can be used to pass arbitrary inline CSS to the main note content. For example, one could center |
The parameter {{para|textstyle}} can be used to pass arbitrary inline CSS to the main note content. For example, one could center small-caps text below a left-aligned heading; this:<br /> |
||
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |textstyle=text-align:center; |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |textstyle=text-align:center; font-variant:small-caps; |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
||
produces: |
produces: |
||
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |textstyle=text-align:center; |
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |textstyle=text-align:center; font-variant:small-caps;|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 a red heading above a left-aligned message; this:<br /> |
Similarly, the parameter {{para|headstyle}} can be used to pass arbitrary inline CSS to the heading content. For example, one could center a red heading above a left-aligned message; this:<br /> |
||
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |headstyle=text-align:center; color:red; |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
{{in5}}<code><nowiki>{{</nowiki>{{BASEPAGENAME}} |heading=Heading |headstyle=text-align:center; color:red; |Lorem ipsum dolor sit amet...<nowiki>}}</nowiki></code> |
||
produces: |
produces: |
||
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |headstyle=text-align:center; color:red; |
{{{{BASEPAGENAME}}|demospace=main |heading=Heading |style=margin-bottom:2.0em; |headstyle=text-align:center; color:red;|Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.}} |
||