Template:Style: Difference between revisions
No edit summary |
m (div --> p) |
||
Line 24: | Line 24: | ||
-->{{#vardefine:output|{{#var:str}}}}<!-- | -->{{#vardefine:output|{{#var:str}}}}<!-- | ||
-->{{#switch: {{{allign|}}} | -->{{#switch: {{{allign|}}} | ||
| left = {{#vardefine:output|< | | left = {{#vardefine:output|<p align=left>{{#var:str}}</p>}} | ||
| center = {{#vardefine:output|< | | center = {{#vardefine:output|<p align=center>{{#var:str}}</p>}} | ||
| right = {{#vardefine:output|< | | right = {{#vardefine:output|<p align=right>{{#var:str}}</p>}} | ||
| #default = {{#vardefine:output|{{#var:str}}}} | | #default = {{#vardefine:output|{{#var:str}}}} | ||
}}{{#var:output}}</includeonly> | }}{{#var:output}}</includeonly> |
Revision as of 03:31, 22 April 2022
This template applies CSS rules to the text and treats it as a block if allign parameter is set.
To copy:
{{Style|text=|css=|allign=}}
If allign is set, then text will be wrapped in <div> tag and handled as a block, otherwise it keeps inline arrangement.
Examples
1. {{Style|text=Some note|css=color: #8B4513; background: #FFE4B5;|allign=}}:
2. {{Style|text=Some note|css=|allign=center}}:
Some note
3. {{Style|text=Some note|css=|allign=right}}:
Some note