Length

constructor(expression: String)

Initializes a Length object by parsing the given expression. Valid expressions are those that include a decimal numeric value followed by one of the recognized unit suffixes:

  • %
  • px
  • ems
Examples:
  • 4.5%
  • 200px
  • 22ems

Parameters

expression

the string expression to parse

See also

<a href="http://www.w3.org/TR/ttaf1-dfxp/#style-value-length">http://www.w3.org/TR/ttaf1-dfxp/#style-value-length</a>

constructor(value: Double, unit: StyledElement.Unit)

Initializes a Length object using the given numeric value and Unit specification.

Parameters

value

the numeric value of the length

unit

the units for the length value