CSSStyleDeclaration Objects

In this chapter you will learn:

  1. Members of the CSSStyleDeclaration
  2. property from CSSStyleDeclaration

Members of the CSSStyleDeclaration

CSSStyleDeclaration object provides the complete control of CSS via the DOM.

The Members of the CSSStyleDeclaration Object

MemberDescriptionReturns
cssTextGets or sets the text of the style.string
getPropertyCSSValue(name)Gets the specified property.CSSPrimitiveValue
getPropertyPriority(name)Gets the priority of the specified property.string
getPropertyValue(name)Gets the specified value as a string.string
item(pos)Gets the item at the specified position.string
lengthGets the number of items.number
parentRuleGets the style rule if there is one.CSSStyleRule
removeProperty(name)Removes the specified property.string
setProperty(name, value, priority)Sets the value and priority for the specified property.void
styleConvenience property to get or set the specified CSS property.string

property from CSSStyleDeclaration

The CSS properties and Convenience style property from CSSStyleDeclaration:

MemberCorresponds To
backgroundbackground
backgroundAttachmentbackground-attachment
backgroundColorbackground-color
backgroundImagebackground-image
backgroundPositionbackground-position
backgroundRepeatbackground-repeat
borderborder
borderBottomborder-bottom
borderBottomColorborder-bottom-color
borderBottomStyleborder-bottom-style
borderBottomWidthborder-bottom-width
borderCollapseborder-collapse
borderColorborder-color
borderLeftborder-left
borderLeftColorborder-left-color
borderLeftStyleborder-left-style
borderLeftWidthborder-left-width
borderRightborder-right
borderRightColorborder-right-color
borderRightStyleborder-right-style
borderRightWidthborder-right-width
borderSpacingborder-spacing
borderStyleborder-style
borderTopborder-top
borderTopColorborder-top-color
borderTopStyleborder-top-style
borderTopWidthborder-top-width
borderWidthborder-width
captionSidecaption-side
clearclear
colorcolor
cssFloatfloat
cursorcursor
directiondirection
displaydisplay
emptyCellsempty-cells
fontfont
fontFamilyfont-family
fontSizefont-size
fontStylefont-style
fontVariantfont-variant
fontWeightfont-weight
heightheight
letterSpacingletter-spacing
lineHeightline-height
listStylelist-style
listStyleImagelist-style-image
listStylePositionlist-style-position
listStyleTypelist-style-type
marginmargin
marginBottommargin-bottom
marginLeftmargin-left
marginRightmargin-right
marginTopmargin-top
maxHeightmax-height
maxWIdthmax-width
minHeightmin-height
minWidthmin-width
outlineoutline
outlineColoroutline-color
outlineStyleoutline-style
outlineWidthoutline-width
overflowoverflow
paddingpadding
paddingBottompadding-bottom
paddingLeftpadding-left
paddingRightpadding-right
paddingToppadding-top
tableLayouttable-layout
textAligntext-align
textDecorationtext-decoration
textIndenttext-indent
textShadowtext-shadow
textTransformtext-transform
visibilityvisibility
whiteSpacewhitespace
widthwidth
wordSpacingword-spacing
zIndexz-index

Next chapter...

What you will learn in the next chapter:

  1. Change the border of an element in Javascript
Home » Javascript Tutorial » CSS
CSSStyleDeclaration Objects
border
padding
cssText
color
getComputedStyle
getPropertyValue
getPropertyCSSValue
getPropertyPriority