English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML DOM Style Object

The Style object represents a single style declaration.

The Style object can be accessed from the document or from the element that applies the style.

Style object properties

The following table lists the properties of the Style object.

"CSS" column indicates in which CSS version the property is defined (CSS1, CSS2or CSS3)

PropertyDescriptionCSS
alignContentSet or return the alignment method between rows in the flexible container when the items do not use all the available space3
alignItemsSet or return the alignment method of items in the flexible container3
alignSelfSet or return the alignment method of the selected items in the flexible container3
animationAll shorthand properties of the following animation properties, except for the animationPlayState property3
animationDelaySet or return the time when the animation starts3
animationDirectionSet or return whether the animation should play alternately once3
animationDurationSet or return how many seconds or milliseconds it takes for the animation to complete one cycle3
animationFillModeSet or return the value applied outside the execution time of the animation3
animationIterationCountSet or return the number of times the animation is played3
animationNameSet or return the name of the @keyframes animation3
animationTimingFunctionSet or return the speed curve of the animation3
animationPlayStateSet or return whether the animation is running or paused3
backgroundSet or return all background properties in one declaration1
backgroundAttachmentSet or return whether the background image is fixed or scrolls with the page1
backgroundColorSet or return the background color of the element1
backgroundImageSet or return the background image of the element1
backgroundPositionSet or return the starting position of the background image1
backgroundRepeatSet or return how the background image is repeated (tiled)1
backgroundClipSet or return the painting area of the background3
backgroundOriginSet or return the positioning area of the background image3
backgroundSizeSet or return the size of the background image3
backfaceVisibilitySet or return whether the element should be visible when not facing the screen3
borderSet or return borderWidth, borderStyle, and borderColor in a single declaration1
borderBottomSet or return all the borderBottom properties in a declaration1
borderBottomColorSet or return the color of the bottom border1
borderBottomLeftRadiusSet or return the shape of the bottom-left border3
borderBottomRightRadiusSet or return the shape of the bottom-right border3
borderBottomStyleSet or return the style of the bottom border1
borderBottomWidthSet or return the width of the bottom border1each
borderCollapseSet or return whether the table borders should be collapsed into a single border2
borderColorSet or return the color of the element's border (up to four values can be specified)1
borderImageA shorthand property for setting or returning all borderImage properties3
borderImageOutsetSet or return the number of border image regions that extend beyond the border3
borderImageRepeatSet or return whether the image boundary should be repeated, rounded, or stretched3
borderImageSliceSet or return the inward offset of the image boundary3
borderImageSourceSet or return the image used as the border3
borderImageWidthSet or return the width of the image border3
borderLeftSet or return all the borderLeft properties in a declaration1
borderLeftColorSet or return the color of the left border1
borderLeftStyleSet or return the style of the left border1
borderLeftWidthSet or return the width of the left border1each
borderRadiusA shorthand property for setting or returning all four borderRadius properties3
borderRightSet or return all the borderRight properties in a declaration1
borderRightColorSet or return the color of the right border1
borderRightStyleSet or return the style of the right border1
borderRightWidthSet or return the width of the right border1
borderSpacingSet or return the space between cells in a table2
borderStyleSet or return the style of the element's border (up to four values can be specified)1
borderTopSet or return all the borderTop properties in a declaration1
borderTopColorSet or return the color of the top border1
borderTopLeftRadiusSet or return the shape of the top left border3
borderTopRightRadiusSet or return the shape of the top right border3
borderTopStyleSet or return the style of the top border1
borderTopWidthSet or return the width of the top border1
borderWidthSet or return the width of the element border (up to four values can be specified)1
bottomSet or return the bottom position of the positioned element2
boxDecorationBreakSet or return the behavior of the background and border of the element at the page break or the behavior of the background and border of the inline element at the line break3
boxShadowAttach one or more shadows to the box3
boxSizingAllows you to define some elements to fit a certain area in a certain way3
captionSideSet or return the position of the table caption2
clearSet or return the position of the element relative to the floating object1
clipSet or return which part of the positioned element is visible2
colorSet or return the color of the text1
columnCountSet or return the number of columns the element should be divided into3
columnFillSet or return how columns are filled3
columnGapSet or return the gap between columns3
columnRuleA shorthand attribute for setting or returning all columnRule properties3
columnRuleColorSet or return the color of the rule between columns3
columnRuleStyleSet or return the rule style between columns3
columnRuleWidthSet or return the rule width between columns3
columnsA shorthand attribute for setting or returning columnWidth and columnCount3
columnSpanSet or return how many columns the element should span3
columnWidthSet or return the width of the column3
contentUsed with :before and :after pseudo-elements to insert generated content2
counterIncrementIncrement one or more counters2
counterResetCreate or reset one or more counters2
cursorSet or return the type of cursor to display to the mouse pointer2
directionSet or return the text direction2
displaySet or return the display type of the element1
emptyCellsSet or return whether to display the border and background of empty cells2
filterSet or return the image filter (visual effects such as blur and saturation)3
flexSet or return the length of the item relative to the rest of the part3
flexBasisSet or return the initial length of the elastic material3
flexDirectionSet or return the direction of the elastic item3
flexFlowAbbreviated property of flexDirection and flexWrap3
flexGrowSet or return the growth of an item relative to other items3
flexShrinkSet or return the shrinkage of an item relative to other items3
flexWrapSet or return whether an elastic item should wrap3
cssFloatSet or return the horizontal alignment of the element1
fontSet or return fontStyle, fontVariant, fontWeight, fontSize, lineHeight, and fontFamily in a single declaration1
fontFamilySet or return the font family of the text1
fontSizeSet or return the font size of the text1
fontStyleSet or return whether the font style is normal, italic, or oblique1
fontVariantSet or return whether the font is displayed in lowercase or uppercase letters1
fontWeightSet or return the boldness of the font1
fontSizeAdjustMaintain the readability of text when font fallback occurs3
fontStretchSelect a normal, condensed, or expanded font from the font family3
hangingPunctuationSpecify whether punctuation can be placed outside the line box3
heightSet or return the height of an element1
hyphensSet how words are split to improve the layout of the paragraph3
iconAllow the author to set the style of an element using iconic equivalent styles3
imageOrientationSpecify the right or clockwise rotation applied to an image by the user agent3
isolationDefine whether an element must create new stacking content3
justifyContentSet or return the alignment of an item within an elastic container when it does not use all available space3
leftSet or return the left position of an element positioned2
letterSpacingSet or return the spacing between characters in text1
lineHeightSet or return the distance between lines of text1
listStyleSet or return listStyleImage, listStylePosition, and listStyleType in a single declaration1
listStyleImageSet or return an image as the list item marker1
listStylePositionSet or return the position of list item marker1
listStyleTypeSet or return the type of list item marker1
marginSet or return the margin of the element (up to four values can be included)1
marginBottomSet or return the bottom margin of the element1
marginLeftSet or return the left margin of the element1
marginRightSet or return the right margin of the element1
marginTopSet or return the top margin of the element1
maxHeightSet or return the maximum height of the element2
maxWidthSet or return the maximum width of the element2
minHeightSet or return the minimum height of the element2
minWidthSet or return the minimum width of the element2
navDownSet or return the navigation position when using the down arrow navigation key3
navIndexSet or return the tab order of the element3
navLeftSet or return the position navigated to when using the left arrow navigation key3
navRightSet or return the navigation position when using the right arrow navigation key3
navUpSet or return the navigation position when using the up arrow navigation key3
objectFitSpecify how the content of the replacement element should fit into the box established by the height and width it uses3
objectPositionSpecify the alignment method of the replacement element within its box3
opacitySet or return the opacity level of the element3
orderSet or return the order of the flexible item relative to the rest of the items3
orphansSet or return the minimum number of lines that must be retained at the bottom of the page when a page break occurs in the element2
outlineSet or return all outline properties in one declaration2
outlineColorSet or return the color of the outline around the element2
outlineOffsetOffset the outline and draw it outside the edge of the border3
outlineStyleSet or return the style of the outline around the element2
outlineWidthSet or return the width of the outline around the element2
overflowSet or return the handling method of the content presented outside the element box2
overflowXSpecify at the left of the content/How to handle when the right edge of the overflow content of the element exceeds the content area3
overflowYSpecify at the top of the content/How to handle when the bottom edge of the overflow content of the element exceeds the content area3
paddingSet or return the padding of the element (up to four values can be included)1
paddingBottomSet or return the bottom padding of the element1
paddingLeftSet or return the left padding of the element1
paddingRightSet or return the right padding of the element1
paddingTopSet or return the top padding of the element1
pageBreakAfterSet or return the pagination behavior after the element2
pageBreakBeforeSet or return the pagination behavior before the element2
pageBreakInsideSet or return the pagination behavior inside the element2
perspectiveSet or return information about how to view3The perspective of the D element3
perspectiveOriginSet or return3The bottom position of the D element3
positionSet or return the type of positioning method used for the element (static, relative, absolute, or fixed)2
quotesSet or return the type of quotation marks used for embedded quotes2
resizeSet or return whether the element can be resized by the user3
rightSet or return the correct position of the positioned element2
tableLayoutSet or return the way of arranging table cells, rows, and columns2
tabSizeSet or return the length of the tab3
textAlignSet or return the horizontal text alignment1
textAlignLastSet or return the alignment method before forced line break when the text alignment is set to 'justify'3
textDecorationSet or return the text decoration1
textDecorationColorSet or return the color of the text decoration3
textDecorationLineSet or return the line type in the text decoration3
textDecorationStyleSet or return the style of the line in the text decoration3
textIndentSet or return the indentation of the first line of the text1
textJustifySet or return the alignment method used when the text alignment is set to 'justify'3
textOverflowSet or return what should happen when the text overflows the containing element3
textShadowSet or return the text shadow effect3
textTransformSet or return the text capitalization1
topSet or return the top position of the positioned element2
transformTo2D or3D transformation is applied to the element3
transformOriginSet or return the position of the element after the transformation3
transformStyleSet or return in3The way elements are rendered in D space3
transitionUsed to set or return the shorthand properties of four transition attributes3
transitionPropertySet or return the CSS properties targeted by the transition effect3
transitionDurationSet or return the number of seconds or milliseconds required for the transition effect to complete3
transitionTimingFunctionSet or return the speed curve of the transition effect3
transitionDelaySet or return the time when the transition effect starts3
unicodeBidiSet or return whether text should be rewritten to support multiple languages in the same document2
userSelectSet or return whether the text of the element can be selected2
verticalAlignSet or return the vertical alignment of the content within the element1
visibilitySet or return whether the element should be visible2
whiteSpaceSet or return how tab characters, line breaks, and spaces are handled in the text1
widthSet or return the width of the element1
wordBreakSet or return the line break rules for non-CJK scripts3
wordSpacingSet or return the spacing between words in the text1
wordWrapAllow long and unbreakable words to be broken and wrapped to the next line3
widowsSet or return the minimum number of lines that must be visible at the top of the page for the element2
zIndexSet or return the stacking order of the positioned element2

Related References

HTML Tutorial:HTML CSS

CSS Tutorial:CSS Tutorial

HTML Reference:HTML <style> Tag

CSS Reference:CSS Properties