getComputedStyle method
Returns a currentStyle object containing the Cascading Style Sheets (CSS) settings that are applied to the specified element or a pseudo-element related to the specified element.
Syntax
HRESULT retVal = object.getComputedStyle(varArgIn, bstrPseudoElt, ppComputedStyle);
Parameters
varArgIn [in]
Type: IHTMLDOMNodeThe element that contains the desired style settings.
bstrPseudoElt [in]
Type: BSTRThe name of a CSS pseudo-element or a NULL value.
ppComputedStyle [out, retval]
Type: IHTMLW3CComputedStyleA currentStyle object that contains the CSS settings applied to the desired object.
The settings in the ppComputedStyle object account for all applicable style rules and represent the final values for the various CSS properties applied to the specified object.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Standards information
- Document Object Model (DOM) Level 2 Style Specification, Section 2.2.1
Remarks
When the bstrPseudoElt is set to a value other than NULL, the value is interpreted as a CSS pseudo-element with respect to the object specified in the varArgIn parameter.