example4_css_units - avoid string operations by adding "_unit" to end of css name

e.g. style:"margin-left:2em;" becomes cssMarginLeft_em:2



show FuncyTag html string output

show Javascript source code

To Notice: Many css properties take a unit (e.g. "em,px,pico,pc,pt,etc....") which in javascript leads to extra string manipulation that is hard to read, such as:
var fontSize = 8;
div( { id:'middle', cssFontSize:fontSize*2+'px', ...
FuncyTag css properties allow the unit to be part of the name (preceded with '_') so such string math isn't needed, e.g.:
var fontSize = 8;
div( { id:'middle', cssFontSize_px:fontSize*2, ...
Note that for the unit percent ("%"), FuncyTag allows the extension "_pct" as in:
div( { id:'middle', cssFontSize_pct:75, ...

next: example4b_css_color top: all js examples