Skip to main content

Size

The CSML language provides many different attributes to define the width and height of an element.

Width​

AttributeTypeDefaultDescription
widthINTEGERDefines the width of the layout boundary. Once left (or percentLeft) or right (or percentRight) is set, the width value no longer applies. If percentWidth exists when width is set, percentWidth will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the width of that display object.
percentWidthINTEGERWhen set, the width of the layout will be set as the value of this property multiplied by the containing width. A value of 0 represents 0% and 1 represents 100%.
minWidthINTEGERThe minimum width that can be applied to the layout boundaries
maxWidthINTEGERThe maximum width that can be applied to the layout boundaries

Height​

AttributeTypeDefaultDescription
heightINTEGERDefines the height of the layout boundary. Once top (or percentTop) or bottom (or percentBottom) is set, the height value no longer applies. If percentHeight exists when height is set, percentHeight will be overridden and be given a value of NaN. When a Layout is created for a display object, this is defined as the height of that display object. The value of height itself cannot be NaN
percentHeightINTEGERWhen set, the height of the layout will be set as the value of this property multiplied by the containing height. A value of 0 represents 0% and 1 represents 100%
minheightINTEGERThe minimum height that can be applied to the layout boundaries
maxHeightINTEGERThe maximum height that can be applied to the layout boundaries

Scope​

These attributes apply to the following statement: