Template:AddPxUnit: Difference between revisions
Jump to navigation
Jump to search
Created page with "<includeonly>{{#if:{{#pos:0123456789|{{#sub:{{{1}}}|-1}}}}|{{{1}}}px|{{{1}}}}}</includeonly><noinclude>{{Documentation|type=Utility}}</noinclude>" |
(No difference)
|
Latest revision as of 14:11, 10 June 2025
Note: parts of or the entire template might not be visible without values provided.
| Main | Documentation | Usage |
Adds the px unit to a numeric value if it does not already have a unit. If it already has a unit, then that unit is kept.
Syntax
- 1: numeric value with or without units
Examples
{{AddPxUnit|50}}
50px
{{AddPxUnit|50px}}
50pxpx
{{AddPxUnit|2em}}
2empx
{{AddPxUnit|inherit}}
inheritpx
{{AddPxUnit|initial}}
initialpx
Template Data
Add the "px" unit to a numeric value if it does not already have a unit
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| 1 | 1 | The numeric value | String | required |