Template:Su: Difference between revisions
From Vigyanwiki
Template>Edokter (bypass templates) |
Template>Wikid77 (set to show {p}/{b} example when standalone; fixed IE6 text-align by using 1 <span> to show both {p}/{b}. Lowered {p} superscript by "line-height:1.1em" for Konqueror 3.5.8; +more NOTES comments) |
||
Line 1: | Line 1: | ||
{{#if:{{{p|<noinclude>x</noinclude>}}} | |||
|{{#if:{{{b|}}} | |{{#if:{{{b|<noinclude>x</noinclude>}}} | ||
|<span style="{{#ifeq:{{{w|}}}|f|font-family:monospace;}}font-size:{{{fontsize|80%}}};line-height:1;margin-bottom:-0. | |<span style="{{#ifeq:{{{w|}}}|f|font-family:monospace;}}font-size:{{{fontsize|80%}}};overflow:visible;display:inline-block; vertical-align: -0.4em; line-height:1.1em; margin-bottom:-0.2em;background:transparent;text-align:{{#switch:{{{a|}}}|r=right|c=center|left}}">{{{p|{{{p}}}}}}<br />{{{b|{{{b}}}}}}</span> | ||
|<sup>{{{p|}}}</sup> | |<sup>{{{p|}}}</sup> | ||
}} | }} | ||
|<sub>{{{b|}}}</sub> | |<sub>{{{b|}}}</sub> | ||
}} | }}<noinclude><!--endif {p} passed | ||
-------------------------------------------------------------- | -------------------------------------------------------------- | ||
--NOTES: | --NOTES: | ||
Line 24: | Line 23: | ||
-- 80%) where 100% is the usual super/subscript size. | -- 80%) where 100% is the usual super/subscript size. | ||
-- | -- | ||
-- NOTE | -- 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 L5: The logic to select the typesetting, is shown by | |||
-- the following 2 nested if-then-else statements: | -- the following 2 nested if-then-else statements: | ||
-- | -- | ||
Line 33: | Line 36: | ||
-- ELSE show subscript {b|} ENDIF | -- ELSE show subscript {b|} ENDIF | ||
-- | -- | ||
-- NOTE | -- NOTE T6: Other templates are used unless {p} & {b} are | ||
-- both specified together: | -- both specified together: | ||
-- Template:sup - shows superscript when only {p} | -- Template:sup - shows superscript when only {p} | ||
Line 48: | Line 51: | ||
--21Dec10 Added NOTES comments to explain template coding. | --21Dec10 Added NOTES comments to explain template coding. | ||
--21Dec10 Added HISTORY comments to log major changes. | --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. | |||
--21Dec10 To avoid extra HTML, cut duplicate "line-height:1". | |||
-- | -- | ||
-->{{documentation}}<!-- | -->{{documentation}}<!-- | ||
-- PLEASE ADD CATEGORIES & INTERWIKIS TO /doc SUBPAGE - NOT HERE. | -- PLEASE ADD CATEGORIES & INTERWIKIS TO /doc SUBPAGE - NOT HERE. | ||
--></noinclude> | --></noinclude> |
Revision as of 23:58, 21 December 2010
{{{p}}}
{{{b}}}
Template documentation
[create]