CSSPrimitiveValue : CSSValue

Single value for a CSS style.

Browser/User Agent Support

IEMozillaNetscapeOperaSafariNetscapte
no1.0+no9.0+1.0+no

Constructors

ConstructorIEMozillaNetscapeOperaSafariNetscapte
Single value for a CSS style.
no1.0+no9.0+1.0+no
 

Properties

PropertyIEMozillaNetscapeOperaSafariNetscapte
Holds the value of a constant. See Remarks for possible values.
no1.0+no9.0+1.0+no
 

Methods

MethodIEMozillaNetscapeOperaSafariNetscapte
Returns the counter object that represents the value of a CSS counter.
no1.0+nononono
 
The value of a number, converted to the appropriate units, if applicable.
no1.0+nononono
 
Returns a Rect object representing the value of a CSS_RECT.
no1.0+nononono
 
Returns a RGBColor object representing the value of a CSS_RGBCOLOR.
no1.0+nononono
 
Returns the value of a string.
no1.0+nononono
 
Sets the value of a number to the specified value for the specified units.
no1.0+nononono
 
Sets a string to the specified value and type.
no1.0+nononono
 

References

Counter | CSSValue | CSSValueList | Rect | RGBColor

Availability

HTML DOM Level 2 | W3C

Constructor Detail

CSSPrimitiveValue CSSPrimitiveValue()

Single value for a CSS style.

Visibility
internal

Property Detail

Number primitiveType - read only

Holds the value of a constant. See Remarks for possible values.

Remarks

The following list of constants describes the possible values for primitiveType:

  • CSS_UNKNOWN = 0 - Unrecognized or unparseable value.
  • CSS_NUMBER = 1 - Number with no units.
  • CSS_PERCENTAGE = 2- Percentage.
  • CSS_EMS = 3 - Relative length in ems.
  • CSS_EXS = 4 - Relative length in exs.
  • CSS_PX = 5 - Length in pixels.
  • CSS_CM = 6 - Absolute length in centimeters.
  • CSS_MM = 7 - Absolute length in millimeters.
  • CSS_IN = 8 - Absolute length in inches.
  • CSS_PT = 9 - Absolute length in points.
  • CSS_PC = 10 - Absolute length in picas.
  • CSS_DEG = 11 - Angle in degrees.
  • CSS_RAD = 12 - Angle in radians.
  • CSS_GRAD = 13 - Angle in grads.
  • CSS_MS = 14 - Time in milliseconds.
  • CSS_S = 15 - Time in seconds.
  • CSS_HZ = 16 - Frequency in hertz.
  • CSS_KHZ = 17 - Frequency in kilohertz.
  • CSS_DIMENSION = 18 - Dimension without units.
  • CSS_STRING = 19 - String.
  • CSS_URI = 20 - URI.
  • CSS_IDENT = 21 - Unique identifier.
  • CSS_ATTR = 22 - Attribute function.
  • CSS_COUNTER = 23 - Counter.
  • CSS_RECT = 24 - Rectangle.
  • CSS_RGBCOLOR = 25 - Color (RGB).
Availability

HTML DOM Level 2 | W3C

Method Detail

getCounterValue() : static Counter

Returns the counter object that represents the value of a CSS counter.

Availability

HTML DOM Level 2 | W3C

getFloatValue(Number unitType) : Number

The value of a number, converted to the appropriate units, if applicable.

NumberunitTypeUnits to convert the value to.

Availability

HTML DOM Level 2 | W3C

getRectValue() : static Rect

Returns a Rect object representing the value of a CSS_RECT.

Availability

HTML DOM Level 2 | W3C

getRGBColorValue() : static RGBColor

Returns a RGBColor object representing the value of a CSS_RGBCOLOR.

Availability

HTML DOM Level 2 | W3C

getStringValue() : static String

Returns the value of a string.

Availability

HTML DOM Level 2 | W3C

setFloatValue(Number unitType, Number floatValue) : void

Sets the value of a number to the specified value for the specified units.

NumberunitTypeUnits to set the number to.
NumberfloatValueValue of the number.

Availability

HTML DOM Level 2 | W3C

setStringValue(Number stringType, String stringValue) : void

Sets a string to the specified value and type.

NumberstringTypeType to set the string to.
StringstringValueValue of the string.

Availability

HTML DOM Level 2 | W3C