|
|
(21 intermediate revisions by 10 users not shown) |
Line 1: |
Line 1: |
| <span style="display:inline-block; margin-bottom:-0.3em; vertical-align:{{#if:{{{b|}}}|-0.4em|0.8em}}; line-height:1.2em; {{#ifeq:{{{w|}}}|f|font-family:monospace,'Courier New';}} font-size:{{{fontsize|85%}}}; text-align:{{#switch:{{{a|}}}|r=right|c=center|left}};"><!--
| | {{{{{|safesubst:}}}#invoke:Su|main}}<noinclude> |
| -->{{{p|}}}<br /><!--
| | {{documentation}} |
| -->{{{b|}}}</span><noinclude><!--
| | <!-- Categories go on the /doc subpage, and interwikis go on Wikidata. --> |
| --------------------------------------------------------------
| | </noinclude> |
| --NOTES:
| |
| -- These comments are omitted by "noinclude" and not put
| |
| -- in pages sent over the Internet, only during edit.
| |
| --
| |
| -- NOTE A1: This template displays either a subscript {b} or
| |
| -- superscript {p}, or both in vertical alignment.
| |
| -- Usage: {{su | p=super | b=sub}}
| |
| --
| |
| -- NOTE C2: For use with browser MS IE6, the result with both
| |
| -- superscript & subscript is a span with vertical "<br/>"
| |
| -- to align the superscript & subscript together.
| |
| --
| |
| -- NOTE F3: The font can be changed by w=f to select the
| |
| -- font-family:monospace, or by fontsize=nn% (default:
| |
| -- 85%) where 100% is the usual font size.
| |
| --
| |
| -- NOTE IE: Because IE6 often handles only 1 style="..." and
| |
| -- does not inherit the prior style, the 2 <span> tags
| |
| -- are combined as 1 <span> when {p}/{b} are both shown.
| |
| --
| |
| -- NOTE N5: The nesting depth of this template was reduced to
| |
| -- just 2 levels (from 4) to avoid the MediaWiki 1.16
| |
| -- "expansion depth limit" inside large templates. The
| |
| -- #switch or #if logic is only 1-level deep.
| |
| --
| |
| --------------------------------------------------------------
| |
| --HISTORY:
| |
| --09Apr08 Created for Template:PhysicsParticle & Template:val.
| |
| --21Dec10 Display super/subscript together by vertical <br>.
| |
| --21Dec10 New parameter fontsize=80% to alter font size.
| |
| --21Dec10 Removed unnecessary "includeonly" tags.
| |
| --21Dec10 Moved {documentation} to bottom as typical.
| |
| --21Dec10 Added NOTES comments to explain template coding.
| |
| --21Dec10 Added HISTORY comments to log major changes.
| |
| --21Dec10 Used 1 <span> when both {p}/{b} for IE6 text-align.
| |
| --21Dec10 Lowered {p} "line-height:1.1em" for Konqueror 3.5.8.
| |
| --22Dec10 Put same span-style/size for single super/subscript.
| |
| --22Dec10 Unnested logic as #if or #switch only for options.
| |
| --22Dec10 Raised "line-height:1.2em" to fit IE6 subscript "g".
| |
| --22Dec10 Raised default font-size:85% to fit more browsers.
| |
| --22Dec10 Omit "text-align:" unless set a=r or a=c (center).
| |
| --22Dec10 Set margin-bottom for browsers w/o vertical-align.
| |
| --22Dec10 New parameter align=right (center) same as a=r/a=c.
| |
| --22Dec10 Cut unneeded HTML "overflow:visible; background...".
| |
| --22Dec10 Fixed to use   when no subscript {b}.
| |
| --23dec10 Re-add default "text-align:" to override surrounding text.
| |
| --
| |
| -->{{documentation}}<!--
| |
| -- PLEASE ADD CATEGORIES & INTERWIKIS TO /doc SUBPAGE - NOT HERE.
| |
| --></noinclude>
| |