Share this Page URL
Help

Returns A read-only CSSStyleDeclaration object (which typically also implements the CSS2Properties interface) that specifies the style information used to render the specified element in this view. Any length values queried from this object are always absolute or pixel values, not relative or percentage values. Description An element in a document may obtain style information from an inline style attribute and from any number of style sheets in the style-sheet "cascade." Before the element can actually be displayed in a view, its style must be "computed" by extracting style information from the appropriate parts of the cascade. This method allows access to those computed styles. By contrast, the style property of an element gives you access only to the inline styles of an element and tells you nothing about style-sheet attributes that apply to the element. Note that this method also provides a way to determine the actual pixel coordinates at which an element is rendered in this view. getComputedStyle( ) is actually defined by the ViewCSS interface. In any DOM implemen- tation that supports the View and CSS modules, any object that implements AbstractView always implements ViewCSS also. So, for simplicity, this method has been listed with Ab- stractView. In Internet Explorer, similar functionality is available through the nonstandard current Style property of each HTMLElement object. See Also CSS2Properties, CSSStyleDeclaration, HTMLElement.style