Template:Px/doc

From Brighter Shores Wiki
Revision as of 13:48, 16 December 2024 by Im Wired In (talk | contribs) (Created page with "{{Documentation}} This template makes it easy to let values for parameters have the suffix "px" removed, to make sure there's only one suffix. For example when a width of a certain element is to be entered, the template could have <code><nowiki><span style="width:{{px|{{{width}}}}}px;">contents</span></nowiki></code> so that for when the template is used, the values <code>|width=50</code> and <code>|width=50px</code> will both result in a width of 50 pixels. When plain p...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
This is a documentation subpage for Template:Px.
It contains usage information, categories, and other content that is not part of the original template page.

This template makes it easy to let values for parameters have the suffix "px" removed, to make sure there's only one suffix. For example when a width of a certain element is to be entered, the template could have <span style="width:{{px|{{{width}}}}}px;">contents</span> so that for when the template is used, the values |width=50 and |width=50px will both result in a width of 50 pixels. When plain parameters would be used, entering |width=50px would result in width:50pxpx; which wouldn't do anything.