Package | dom.style.css |
Class | public class CSSStyleDeclaration |
Inheritance | CSSStyleDeclaration Object |
Introduced in: | DOM 2 Core |
TODO: Add MS proprietary methods
See also
Property | Defined By | ||
---|---|---|---|
DOM 2 Style cssText : DOMString [read-only]
The parsable textual representation of the declaration block (excluding the
surrounding curly braces). | CSSStyleDeclaration | ||
DOM 2 Style length : Number [read-only]
The number of properties that have been explicitly set in this declaration block. | CSSStyleDeclaration | ||
DOM 2 Style parentRule : CSSRule [read-only]
The CSS rule that contains this declaration block or null if this CSSStyleDeclaration
is not attached to a CSSRule. | CSSStyleDeclaration |
Method | Defined By | ||
---|---|---|---|
Used to retrieve the object representation of the value of a CSS property if it has been explicitly
set within this declaration block. | CSSStyleDeclaration | ||
Used to retrieve the priority of a CSS property (e.g. | CSSStyleDeclaration | ||
Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block. | CSSStyleDeclaration | ||
Used to retrieve the properties that have been explicitly set in this declaration block. | CSSStyleDeclaration | ||
Used to remove a CSS property if it has been explicitly set within this declaration block. | CSSStyleDeclaration | ||
Used to set a property value and priority within this declaration block. | CSSStyleDeclaration |
DOM 2 Style cssText | property |
cssText:DOMString
[read-only] Introduced in: | DOM 2 Core |
The parsable textual representation of the declaration block (excluding the surrounding curly braces).
Setting this attribute will result in the parsing of the new value and resetting of all the properties in the declaration block including the removal or addition of properties.
public function get cssText():DOMString
DOMException — SYNTAX_ERR: Raised if the specified CSS string
value has a syntax error and is unparsable.
| |
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this
declaration is readonly or a property is readonly.
|
See also
DOM 2 Style length | property |
length:Number
[read-only] Introduced in: | DOM 2 Core |
The number of properties that have been explicitly set in this declaration block. The range of valid indices is 0 to length-1 inclusive.
public function get length():Number
See also
DOM 2 Style parentRule | property |
parentRule:CSSRule
[read-only] Introduced in: | DOM 2 Core |
The CSS rule that contains this declaration block or null if this CSSStyleDeclaration is not attached to a CSSRule.
public function get parentRule():CSSRule
See also
DOM 2 Style getPropertyCSSValue | () | method |
public function getPropertyCSSValue(propertyName:DOMString):CSSValue
Introduced in: | DOM 2 Core |
Used to retrieve the object representation of the value of a CSS property if it has been explicitly set within this declaration block. This method returns null if the property is a shorthand property. Shorthand property values can only be accessed and modified as strings, using the getPropertyValue and setProperty methods.
Parameters
propertyName:DOMString — The name of the CSS property.
|
CSSValue — Returns the value of the property if it has been explicitly set for this declaration block.
Returns null if the property has not been set.
|
See also
DOM 2 Style getPropertyPriority | () | method |
public function getPropertyPriority(propertyName:DOMString):DOMString
Introduced in: | DOM 2 Core |
Used to retrieve the priority of a CSS property (e.g. the "important" qualifier) if the property has been explicitly set in this declaration block.
Parameters
propertyName:DOMString — The name of the CSS property.
|
DOMString — A string representing the priority (e.g. "important") if one exists. The empty string if none exists.
|
See also
DOM 2 Style getPropertyValue | () | method |
public function getPropertyValue(propertyName:DOMString):DOMString
Introduced in: | DOM 2 Core |
Used to retrieve the value of a CSS property if it has been explicitly set within this declaration block.
Parameters
propertyName:DOMString — The name of the CSS property.
|
DOMString — Returns the value of the property if it has been explicitly set for this declaration block.
Returns the empty string if the property has not been set.
|
See also
DOM 2 Style item | () | method |
public function item(index:Number):DOMString
Introduced in: | DOM 2 Core |
Used to retrieve the properties that have been explicitly set in this declaration block. The order of the properties retrieved using this method does not have to be the order in which they were set. This method can be used to iterate over all properties in this declaration block.
Parameters
index:Number — Index of the property name to retrieve.
|
DOMString — The name of the property at this ordinal position. The empty string if no property
exists at this position.
|
See also
DOM 2 Style removeProperty | () | method |
public function removeProperty(propertyName:DOMString):DOMString
Introduced in: | DOM 2 Core |
Used to remove a CSS property if it has been explicitly set within this declaration block.
Parameters
propertyName:DOMString — The name of the CSS property.
|
DOMString — Returns the value of the property if it has been explicitly set for this declaration
block. Returns the empty string if the property has not been set or the property name does
not correspond to a known CSS property.
|
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
is readonly or the property is readonly.
|
See also
DOM 2 Style setProperty | () | method |
public function setProperty(propertyName:DOMString, value:DOMString, priority:DOMString):void
Introduced in: | DOM 2 Core |
Used to set a property value and priority within this declaration block.
Parameters
propertyName:DOMString — The name of the CSS property.
| |
value:DOMString — The new value of the property.
| |
priority:DOMString — The new priority of the property (e.g. "important").
|
DOMException — SYNTAX_ERR: Raised if the specified value has a syntax
error and is unparsable.
| |
DOMException — NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration
is readonly or the property is readonly.
|
See also