English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
The following table lists the properties of the Style object.
"CSS" column indicates in which CSS version the property is defined (CSS1, CSS2or CSS3)
Property | Description | CSS |
---|---|---|
alignContent | Set or return the alignment method between rows in the flexible container when the items do not use all the available space | 3 |
alignItems | Set or return the alignment method of items in the flexible container | 3 |
alignSelf | Set or return the alignment method of the selected items in the flexible container | 3 |
animation | All shorthand properties of the following animation properties, except for the animationPlayState property | 3 |
animationDelay | Set or return the time when the animation starts | 3 |
animationDirection | Set or return whether the animation should play alternately once | 3 |
animationDuration | Set or return how many seconds or milliseconds it takes for the animation to complete one cycle | 3 |
animationFillMode | Set or return the value applied outside the execution time of the animation | 3 |
animationIterationCount | Set or return the number of times the animation is played | 3 |
animationName | Set or return the name of the @keyframes animation | 3 |
animationTimingFunction | Set or return the speed curve of the animation | 3 |
animationPlayState | Set or return whether the animation is running or paused | 3 |
background | Set or return all background properties in one declaration | 1 |
backgroundAttachment | Set or return whether the background image is fixed or scrolls with the page | 1 |
backgroundColor | Set or return the background color of the element | 1 |
backgroundImage | Set or return the background image of the element | 1 |
backgroundPosition | Set or return the starting position of the background image | 1 |
backgroundRepeat | Set or return how the background image is repeated (tiled) | 1 |
backgroundClip | Set or return the painting area of the background | 3 |
backgroundOrigin | Set or return the positioning area of the background image | 3 |
backgroundSize | Set or return the size of the background image | 3 |
backfaceVisibility | Set or return whether the element should be visible when not facing the screen | 3 |
border | Set or return borderWidth, borderStyle, and borderColor in a single declaration | 1 |
borderBottom | Set or return all the borderBottom properties in a declaration | 1 |
borderBottomColor | Set or return the color of the bottom border | 1 |
borderBottomLeftRadius | Set or return the shape of the bottom-left border | 3 |
borderBottomRightRadius | Set or return the shape of the bottom-right border | 3 |
borderBottomStyle | Set or return the style of the bottom border | 1 |
borderBottomWidth | Set or return the width of the bottom border | 1each |
borderCollapse | Set or return whether the table borders should be collapsed into a single border | 2 |
borderColor | Set or return the color of the element's border (up to four values can be specified) | 1 |
borderImage | A shorthand property for setting or returning all borderImage properties | 3 |
borderImageOutset | Set or return the number of border image regions that extend beyond the border | 3 |
borderImageRepeat | Set or return whether the image boundary should be repeated, rounded, or stretched | 3 |
borderImageSlice | Set or return the inward offset of the image boundary | 3 |
borderImageSource | Set or return the image used as the border | 3 |
borderImageWidth | Set or return the width of the image border | 3 |
borderLeft | Set or return all the borderLeft properties in a declaration | 1 |
borderLeftColor | Set or return the color of the left border | 1 |
borderLeftStyle | Set or return the style of the left border | 1 |
borderLeftWidth | Set or return the width of the left border | 1each |
borderRadius | A shorthand property for setting or returning all four borderRadius properties | 3 |
borderRight | Set or return all the borderRight properties in a declaration | 1 |
borderRightColor | Set or return the color of the right border | 1 |
borderRightStyle | Set or return the style of the right border | 1 |
borderRightWidth | Set or return the width of the right border | 1 |
borderSpacing | Set or return the space between cells in a table | 2 |
borderStyle | Set or return the style of the element's border (up to four values can be specified) | 1 |
borderTop | Set or return all the borderTop properties in a declaration | 1 |
borderTopColor | Set or return the color of the top border | 1 |
borderTopLeftRadius | Set or return the shape of the top left border | 3 |
borderTopRightRadius | Set or return the shape of the top right border | 3 |
borderTopStyle | Set or return the style of the top border | 1 |
borderTopWidth | Set or return the width of the top border | 1 |
borderWidth | Set or return the width of the element border (up to four values can be specified) | 1 |
bottom | Set or return the bottom position of the positioned element | 2 |
boxDecorationBreak | Set 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 break | 3 |
boxShadow | Attach one or more shadows to the box | 3 |
boxSizing | Allows you to define some elements to fit a certain area in a certain way | 3 |
captionSide | Set or return the position of the table caption | 2 |
clear | Set or return the position of the element relative to the floating object | 1 |
clip | Set or return which part of the positioned element is visible | 2 |
color | Set or return the color of the text | 1 |
columnCount | Set or return the number of columns the element should be divided into | 3 |
columnFill | Set or return how columns are filled | 3 |
columnGap | Set or return the gap between columns | 3 |
columnRule | A shorthand attribute for setting or returning all columnRule properties | 3 |
columnRuleColor | Set or return the color of the rule between columns | 3 |
columnRuleStyle | Set or return the rule style between columns | 3 |
columnRuleWidth | Set or return the rule width between columns | 3 |
columns | A shorthand attribute for setting or returning columnWidth and columnCount | 3 |
columnSpan | Set or return how many columns the element should span | 3 |
columnWidth | Set or return the width of the column | 3 |
content | Used with :before and :after pseudo-elements to insert generated content | 2 |
counterIncrement | Increment one or more counters | 2 |
counterReset | Create or reset one or more counters | 2 |
cursor | Set or return the type of cursor to display to the mouse pointer | 2 |
direction | Set or return the text direction | 2 |
display | Set or return the display type of the element | 1 |
emptyCells | Set or return whether to display the border and background of empty cells | 2 |
filter | Set or return the image filter (visual effects such as blur and saturation) | 3 |
flex | Set or return the length of the item relative to the rest of the part | 3 |
flexBasis | Set or return the initial length of the elastic material | 3 |
flexDirection | Set or return the direction of the elastic item | 3 |
flexFlow | Abbreviated property of flexDirection and flexWrap | 3 |
flexGrow | Set or return the growth of an item relative to other items | 3 |
flexShrink | Set or return the shrinkage of an item relative to other items | 3 |
flexWrap | Set or return whether an elastic item should wrap | 3 |
cssFloat | Set or return the horizontal alignment of the element | 1 |
font | Set or return fontStyle, fontVariant, fontWeight, fontSize, lineHeight, and fontFamily in a single declaration | 1 |
fontFamily | Set or return the font family of the text | 1 |
fontSize | Set or return the font size of the text | 1 |
fontStyle | Set or return whether the font style is normal, italic, or oblique | 1 |
fontVariant | Set or return whether the font is displayed in lowercase or uppercase letters | 1 |
fontWeight | Set or return the boldness of the font | 1 |
fontSizeAdjust | Maintain the readability of text when font fallback occurs | 3 |
fontStretch | Select a normal, condensed, or expanded font from the font family | 3 |
hangingPunctuation | Specify whether punctuation can be placed outside the line box | 3 |
height | Set or return the height of an element | 1 |
hyphens | Set how words are split to improve the layout of the paragraph | 3 |
icon | Allow the author to set the style of an element using iconic equivalent styles | 3 |
imageOrientation | Specify the right or clockwise rotation applied to an image by the user agent | 3 |
isolation | Define whether an element must create new stacking content | 3 |
justifyContent | Set or return the alignment of an item within an elastic container when it does not use all available space | 3 |
left | Set or return the left position of an element positioned | 2 |
letterSpacing | Set or return the spacing between characters in text | 1 |
lineHeight | Set or return the distance between lines of text | 1 |
listStyle | Set or return listStyleImage, listStylePosition, and listStyleType in a single declaration | 1 |
listStyleImage | Set or return an image as the list item marker | 1 |
listStylePosition | Set or return the position of list item marker | 1 |
listStyleType | Set or return the type of list item marker | 1 |
margin | Set or return the margin of the element (up to four values can be included) | 1 |
marginBottom | Set or return the bottom margin of the element | 1 |
marginLeft | Set or return the left margin of the element | 1 |
marginRight | Set or return the right margin of the element | 1 |
marginTop | Set or return the top margin of the element | 1 |
maxHeight | Set or return the maximum height of the element | 2 |
maxWidth | Set or return the maximum width of the element | 2 |
minHeight | Set or return the minimum height of the element | 2 |
minWidth | Set or return the minimum width of the element | 2 |
navDown | Set or return the navigation position when using the down arrow navigation key | 3 |
navIndex | Set or return the tab order of the element | 3 |
navLeft | Set or return the position navigated to when using the left arrow navigation key | 3 |
navRight | Set or return the navigation position when using the right arrow navigation key | 3 |
navUp | Set or return the navigation position when using the up arrow navigation key | 3 |
objectFit | Specify how the content of the replacement element should fit into the box established by the height and width it uses | 3 |
objectPosition | Specify the alignment method of the replacement element within its box | 3 |
opacity | Set or return the opacity level of the element | 3 |
order | Set or return the order of the flexible item relative to the rest of the items | 3 |
orphans | Set or return the minimum number of lines that must be retained at the bottom of the page when a page break occurs in the element | 2 |
outline | Set or return all outline properties in one declaration | 2 |
outlineColor | Set or return the color of the outline around the element | 2 |
outlineOffset | Offset the outline and draw it outside the edge of the border | 3 |
outlineStyle | Set or return the style of the outline around the element | 2 |
outlineWidth | Set or return the width of the outline around the element | 2 |
overflow | Set or return the handling method of the content presented outside the element box | 2 |
overflowX | Specify at the left of the content/How to handle when the right edge of the overflow content of the element exceeds the content area | 3 |
overflowY | Specify at the top of the content/How to handle when the bottom edge of the overflow content of the element exceeds the content area | 3 |
padding | Set or return the padding of the element (up to four values can be included) | 1 |
paddingBottom | Set or return the bottom padding of the element | 1 |
paddingLeft | Set or return the left padding of the element | 1 |
paddingRight | Set or return the right padding of the element | 1 |
paddingTop | Set or return the top padding of the element | 1 |
pageBreakAfter | Set or return the pagination behavior after the element | 2 |
pageBreakBefore | Set or return the pagination behavior before the element | 2 |
pageBreakInside | Set or return the pagination behavior inside the element | 2 |
perspective | Set or return information about how to view3The perspective of the D element | 3 |
perspectiveOrigin | Set or return3The bottom position of the D element | 3 |
position | Set or return the type of positioning method used for the element (static, relative, absolute, or fixed) | 2 |
quotes | Set or return the type of quotation marks used for embedded quotes | 2 |
resize | Set or return whether the element can be resized by the user | 3 |
right | Set or return the correct position of the positioned element | 2 |
tableLayout | Set or return the way of arranging table cells, rows, and columns | 2 |
tabSize | Set or return the length of the tab | 3 |
textAlign | Set or return the horizontal text alignment | 1 |
textAlignLast | Set or return the alignment method before forced line break when the text alignment is set to 'justify' | 3 |
textDecoration | Set or return the text decoration | 1 |
textDecorationColor | Set or return the color of the text decoration | 3 |
textDecorationLine | Set or return the line type in the text decoration | 3 |
textDecorationStyle | Set or return the style of the line in the text decoration | 3 |
textIndent | Set or return the indentation of the first line of the text | 1 |
textJustify | Set or return the alignment method used when the text alignment is set to 'justify' | 3 |
textOverflow | Set or return what should happen when the text overflows the containing element | 3 |
textShadow | Set or return the text shadow effect | 3 |
textTransform | Set or return the text capitalization | 1 |
top | Set or return the top position of the positioned element | 2 |
transform | To2D or3D transformation is applied to the element | 3 |
transformOrigin | Set or return the position of the element after the transformation | 3 |
transformStyle | Set or return in3The way elements are rendered in D space | 3 |
transition | Used to set or return the shorthand properties of four transition attributes | 3 |
transitionProperty | Set or return the CSS properties targeted by the transition effect | 3 |
transitionDuration | Set or return the number of seconds or milliseconds required for the transition effect to complete | 3 |
transitionTimingFunction | Set or return the speed curve of the transition effect | 3 |
transitionDelay | Set or return the time when the transition effect starts | 3 |
unicodeBidi | Set or return whether text should be rewritten to support multiple languages in the same document | 2 |
userSelect | Set or return whether the text of the element can be selected | 2 |
verticalAlign | Set or return the vertical alignment of the content within the element | 1 |
visibility | Set or return whether the element should be visible | 2 |
whiteSpace | Set or return how tab characters, line breaks, and spaces are handled in the text | 1 |
width | Set or return the width of the element | 1 |
wordBreak | Set or return the line break rules for non-CJK scripts | 3 |
wordSpacing | Set or return the spacing between words in the text | 1 |
wordWrap | Allow long and unbreakable words to be broken and wrapped to the next line | 3 |
widows | Set or return the minimum number of lines that must be visible at the top of the page for the element | 2 |
zIndex | Set or return the stacking order of the positioned element | 2 |
HTML Tutorial:HTML CSS
CSS Tutorial:CSS Tutorial
HTML Reference:HTML <style> Tag
CSS Reference:CSS Properties