nsCSSValue value; value.SetFloatValue(0); value.SetRGBColorValue(255, 0, 0); // Set the color to red // Use the value object in some way, such as setting a CSS property someElement.SetComputedStyleProperty("color", value);
nsCSSValue value; value.SetFloatValue(12.0f); value.SetUnit(eCSSUnit_Point); // Set the unit to points // Use the value object in some way, such as setting a CSS property someElement.SetComputedStyleProperty("font-size", value);These examples use the nsCSSValue class from the Mozilla Gecko rendering engine. The nsCSSValue class is part of the Mozilla layout package library.