Package | dom.style.css |
Interface | public interface ElementCSSInlineStyle |
Implementors | HTMLElement |
Introduced in: | DOM 2 Core |
This represents the contents of the STYLE attribute for HTML elements (or elements in other schemas or DTDs which use the STYLE attribute in the same way). The expectation is that an instance of the ElementCSSInlineStyle interface can be obtained by using binding-specific casting methods on an instance of the Element interface when the element supports inline CSS style informations.
See also
Property | Defined By | ||
---|---|---|---|
DOM 2 Style style : CSSStyleDeclaration [read-only]
Returns an object that represents the element's style attribute. | ElementCSSInlineStyle |
DOM 2 Style style | property |
style:CSSStyleDeclaration
[read-only] Introduced in: | DOM 2 Core |
Returns an object that represents the element's style attribute.
Note: Since the style property has the same (and highest) priority in the CSS cascade as an inline style declaration via the style attribute, it is useful for setting style on one specific element.
Note: However, it is not useful for learning about the element's style in general, since it represents only the CSS declarations set in the element's inline style attribute, not those that come from style rules elsewhere, such as style rules in the <head> section, or external style sheets.
Note: To get the values of all CSS properties for an element you should use window.getComputedStyle instead.
public function get style():CSSStyleDeclaration
See also
var div = document.getElementById("div1"); div.style.marginTop = ".25in";