Enum LengthUnit
public enum LengthUnit
Fields
Inches = 7inches 1in = 2.54cm = 96px
Number = 0No unit specified, interpreted as a value in pixels.
Percent = 1Percent is relative to least distant viewbox dimensions. If the length is inherently horizontal, like "dx", then the percentage is relative to the least distant viewbox width. If the length is inherently vertical, like "dy", then the percentage is relative to the least distant viewbox height. Otherwise the percentage is relative to the least distant viewbox diagonal.
Setting a unit of Percent may be converted into PercentWidth, PercentHeight, or PercentDiagonal
PercentDiagonal = 19Percentage is relative to the least distant viewbox diagonal
PercentHeight = 18Percentage is relative to the least distant viewbox height.
PercentWidth = 17Percentage is relative to the least distant viewbox width.
Q = 10quarter-millimeters 1Q = 1/40th of 1cm
Unknown = -1A unit was detected but not recgonized.
ch = 11Relative to character advance of the “0” (ZERO, U+0030) glyph in the element’s font
cm = 5centimeters 1cm = 96px/2.54
em = 2Relative to font size of the element
ex = 3Relative to x-height of the element’s font
mm = 6millimeters 1mm = 1/10th of 1cm
pc = 9picas 1pc = 1/6th of 1in
pt = 8points 1pt = 1/72nd of 1in
px = 4pixels 1px = 1/96th of 1in
rem = 12Relative to font size of the root element
vh = 14Relative to 1% of viewport’s height
vmax = 16Relative to 1% of viewport’s larger dimension
vmin = 15Relative to 1% of viewport’s smaller dimension
vw = 13Relative to 1% of viewport’s width