IViewCSS.GetComputedStyle
GetComputedStyle(Element)
The IViewCSS.getComputedStyle() method returns an object containing the values of all CSS properties of an element, after applying active stylesheets and resolving any basic computation those values may contain.
Individual CSS property values are accessed through APIs provided by the object, or by indexing with CSS property names.
public ICSSStyleDeclaration GetComputedStyle(Element element)
Parameter | Type | Description |
---|---|---|
element | Element | The Element for which to get the computed style. This parameter cannot be null. |
Return Value
The returned style is a live CSSStyleDeclaration
object, which updates automatically when the element’s styles are changed.
Exceptions
exception | condition |
---|---|
TypeError | If the passed object is not an Element or the pseudoElt is not a valid pseudo-element selector. |
Remarks
CSSOM defines APIs (including generic parsing and serialization rules) for Media Queries, Selectors, and of course CSS itself.
Reference
CSS Working Group - The CSS Working Group is the W3C working group chartered to develop Cascading Style Sheets (CSS).CSS Object Model (CSSOM) - CSSOM defines APIs (including generic parsing and serialization rules) for Media Queries, Selectors, and of course CSS itself.CSS Object Model (CSSOM) # dom-window-getcomputedstyle – The CSSOM definition.
See Also
- interface ICSSStyleDeclaration
- class Element
- interface IViewCSS
- package com.aspose.html.Dom.Css
- package Aspose.HTML
GetComputedStyle(Element, String)
The IViewCSS.getComputedStyle() method returns an object containing the values of all CSS properties of an element, after applying active stylesheets and resolving any basic computation those values may contain.
Individual CSS property values are accessed through APIs provided by the object, or by indexing with CSS property names.
public ICSSStyleDeclaration GetComputedStyle(Element element, String pseudoElement)
Parameter | Type | Description |
---|---|---|
element | Element | The Element for which to get the computed style. This parameter cannot be null. |
pseudoElement | String | A String specifying the pseudo-element to match. Omitted (or null) for real elements. |
Return Value
The returned style is a live CSSStyleDeclaration
object, which updates automatically when the element’s styles are changed.
Exceptions
exception | condition |
---|---|
TypeError | If the passed object is not an Element or the pseudoElt is not a valid pseudo-element selector. |
Remarks
CSSOM defines APIs (including generic parsing and serialization rules) for Media Queries, Selectors, and of course CSS itself.
Reference
CSS Working Group - The CSS Working Group is the W3C working group chartered to develop Cascading Style Sheets (CSS).CSS Object Model (CSSOM) - CSSOM defines APIs (including generic parsing and serialization rules) for Media Queries, Selectors, and of course CSS itself.CSS Object Model (CSSOM) # dom-window-getcomputedstyle – The CSSOM definition.
See Also
- interface ICSSStyleDeclaration
- class Element
- interface IViewCSS
- package com.aspose.html.Dom.Css
- package Aspose.HTML