INPUT /  OUTPUT /  LANGUAGE






margin, marginBottom, marginLeft, marginRight, marginTop fields

Category: vector field

This collection of fields specifies the width of internal margin spacing to be added between the edge of an object and its inner content.

Specifying a distance value for this field

This field takes a distance value specified with either one or two value elements.

If the units are not specified, the distance is interpreted in pixels (px) by default.
Unit specifierDescriptionExampleInterpretation
None Pixels (default units)55 pixels
px Pixels (explicitly stated)5,px 5 pixels
% Percentage units20,% 5%
pt Typesetting point units12,pt 12pt text size
em Multiple of current font size1.2,em 1.2 × current font size
Some programming languages use % symbols as placeholders when printing output to the console. In such cases, you might need to ouput the % character in a different way. For example, in C's printf function, you would need to specify 50,% as 50,%%.

Getting a value from this field

When getting a value for this field, a single numerical value in pixels is produced.