# CSSPrimitiveValue : CSSValue
Return to: HTML DOM Level 2 index

Single value for a CSS style.

## Platform Support

IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | ---
no | 1.0+ | no | 9.0+ | 1.0+

## Constructors

Constructor | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
CSSPrimitiveValue Constructor() : CSSPrimitiveValue Single value for a CSS style. | Show Details | no | 1.0+ | no | 9.0+ | 1.0+

### CSSPrimitiveValue() : CSSPrimitiveValue

Single value for a CSS style.

Returns

CSSPrimitiveValue |

Visibility
  internal

## Inherited Properties

Property | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
cssText : String Text representing the CSS value. | Show Details | no | 1.0+ | no | no | no

  For examples, see the quirksmode test page:

  http://www.quirksmode.org/dom/tests/stylesheets.html

Availability

  HTML DOM Level 2|W3C

cssValueType : Number Type of CSS value represented by the object. See remarks for possible values. | Show Details | no | 1.0+ | no | no | no

Remarks

  The following constants are valid values for `cssValueType`:

  - `CSS_INHERIT = 0` - Indicates that the value of the CSS style attribute is inherited.
  - `CSS_PRIMITIVE_VALUE = 1` - Indicates that the value of the CSS style attribute is a primitive value.
  - `CSS_VALUE_LIST = 2` - Indicates that the CSS value actually contains a list of values.
  - `CSS_CUSTOM = 3` - Indicates that the CSS value is of a type not supported by CSS or DOM standards.
Availability

  HTML DOM Level 2|W3C

## Properties

Property | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
primitiveType : Number Holds the value of a constant. See Remarks for possible values. | Show Details | no | 1.0+ | no | 9.0+ | 1.0+

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

## Functions

Method | Action | IE | Mozilla | Netscape | Opera | Safari
--- | --- | --- | --- | --- | --- | ---
static getCounterValue() : Counter Returns the counter object that represents the value of a CSS counter. | Show Details | no | 1.0+ | no | no | no

Returns

Counter |

Availability

  HTML DOM Level 2|W3C

getFloatValue(Number unitType) : Number The value of a number, converted to the appropriate units, if applicable. | Show Details | no | 1.0+ | no | no | no

Parameters

Number | unitType | Units to convert the value to.

Returns

Number |

Availability

  HTML DOM Level 2|W3C

static getRectValue() : Rect Returns a Rect object representing the value of a CSS_RECT. | Show Details | no | 1.0+ | no | no | no

Returns

Rect |

Availability

  HTML DOM Level 2|W3C

static getRGBColorValue() : RGBColor Returns a RGBColor object representing the value of a CSS_RGBCOLOR. | Show Details | no | 1.0+ | no | no | no

Returns

RGBColor |

Availability

  HTML DOM Level 2|W3C

static getStringValue() : String Returns the value of a string. | Show Details | no | 1.0+ | no | no | no

Returns

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. | Show Details | no | 1.0+ | no | no | no

Parameters

Number | unitType | Units to set the number to.
Number | floatValue | Value of the number.

Returns

void |

Availability

  HTML DOM Level 2|W3C

setStringValue(Number stringType, String stringValue) : void Sets a string to the specified value and type. | Show Details | no | 1.0+ | no | no | no

Parameters

Number | stringType | Type to set the string to.
String | stringValue | Value of the string.

Returns

void |

Availability

  HTML DOM Level 2|W3C

## References

Counter|CSSValue|CSSValueList|Rect|RGBColor

## Availability

HTML DOM Level 2|W3C

text_javascript aptana_docs