Style

Обновлено: 27.03.2023

Об'єкт Style

Об'єкт Style представляє індивідуальний стиль об'єкту.

Синтаксис

Повертає вказану властивість:

object.style.*властивість*

Встановіть вказану властивість:

object.style.*властивість*= "*значення властивості*"

Значення властивості встановлюються відповідно до значень властивостей стилів елементів в CSS.

Властивості об’єкта стилю

PropertyDescription
alignContentSets or returns the alignment between the lines inside a flexible container when the items do not use all available space
alignItemsSets or returns the alignment for items inside a flexible container
alignSelfSets or returns the alignment for selected items inside a flexible container
animationA shorthand property for all the animation properties below, except the animationPlayState property
animationDelaySets or returns when the animation will start
animationDirectionSets or returns whether or not the animation should play in reverse on alternate cycles
animationDurationSets or returns how many seconds or milliseconds an animation takes to complete one cycle
animationFillModeSets or returns what values are applied by the animation outside the time it is executing
animationIterationCountSets or returns the number of times an animation should be played
animationNameSets or returns a name for the @keyframes animation
animationTimingFunctionSets or returns the speed curve of the animation
animationPlayStateSets or returns whether the animation is running or paused
backgroundSets or returns all the background properties in one declaration
backgroundAttachmentSets or returns whether a background-image is fixed or scrolls with the page
backgroundColorSets or returns the background-color of an element
backgroundImageSets or returns the background-image for an element
backgroundPositionSets or returns the starting position of a background-image
backgroundRepeatSets or returns how to repeat (tile) a background-image
backgroundClipSets or returns the painting area of the background
backgroundOriginSets or returns the positioning area of the background images
backgroundSizeSets or returns the size of the background image
backfaceVisibilitySets or returns whether or not an element should be visible when not facing the screen
borderSets or returns borderWidth, borderStyle, and borderColor in one declaration
borderBottomSets or returns all the borderBottom properties in one declaration
borderBottomColorSets or returns the color of the bottom border
borderBottomLeftRadiusSets or returns the shape of the border of the bottom-left corner
borderBottomRightRadiusSets or returns the shape of the border of the bottom-right corner
borderBottomStyleSets or returns the style of the bottom border
borderBottomWidthSets or returns the width of the bottom border
borderCollapseSets or returns whether the table border should be collapsed into a single border, or not
borderColorSets or returns the color of an element's border (can have up to four values)
borderImageA shorthand property for setting or returning all the borderImage properties
borderImageOutsetSets or returns the amount by which the border image area extends beyond the border box
borderImageRepeatSets or returns whether the image-border should be repeated, rounded or stretched
borderImageSliceSets or returns the inward offsets of the image-border
borderImageSourceSets or returns the image to be used as a border
borderImageWidthSets or returns the widths of the image-border
borderLeftSets or returns all the borderLeft properties in one declaration
borderLeftColorSets or returns the color of the left border
borderLeftStyleSets or returns the style of the left border
borderLeftWidthSets or returns the width of the left border
borderRadiusA shorthand property for setting or returning all the four borderRadius properties
borderRightSets or returns all the borderRight properties in one declaration
borderRightColorSets or returns the color of the right border
borderRightStyleSets or returns the style of the right border
borderRightWidthSets or returns the width of the right border
borderSpacingSets or returns the space between cells in a table
borderStyleSets or returns the style of an element's border (can have up to four values)
borderTopSets or returns all the borderTop properties in one declaration
borderTopColorSets or returns the color of the top border
borderTopLeftRadiusSets or returns the shape of the border of the top-left corner
borderTopRightRadiusSets or returns the shape of the border of the top-right corner
borderTopStyleSets or returns the style of the top border
borderTopWidthSets or returns the width of the top border
borderWidthSets or returns the width of an element's border (can have up to four values)
bottomSets or returns the bottom position of a positioned element
boxDecorationBreakSets or returns the behaviour of the background and border of an element at page-break, or, for in-line elements, at line-break.
boxShadowAttaches one or more drop-shadows to the box
boxSizingAllows you to define certain elements to fit an area in a certain way
captionSideSets or returns the position of the table caption
caretColorSets or returns the caret/cursor color of an element
clearSets or returns the position of the element relative to floating objects
clipSets or returns which part of a positioned element is visible
colorSets or returns the color of the text
columnCountSets or returns the number of columns an element should be divided into
columnFillSets or returns how to fill columns
columnGapSets or returns the gap between the columns
columnRuleA shorthand property for setting or returning all the columnRule properties
columnRuleColorSets or returns the color of the rule between columns
columnRuleStyleSets or returns the style of the rule between columns
columnRuleWidthSets or returns the width of the rule between columns
columnsA shorthand property for setting or returning columnWidth and columnCount
columnSpanSets or returns how many columns an element should span across
columnWidthSets or returns the width of the columns
contentUsed with the :before and :after pseudo-elements, to insert generated content
counterIncrementIncrements one or more counters
counterResetCreates or resets one or more counters
cursorSets or returns the type of cursor to display for the mouse pointer
directionSets or returns the text direction
displaySets or returns an element's display type
emptyCellsSets or returns whether to show the border and background of empty cells, or not
filterSets or returns image filters (visual effects, like blur and saturation)
flexSets or returns the length of the item, relative to the rest
flexBasisSets or returns the initial length of a flexible item
flexDirectionSets or returns the direction of the flexible items
flexFlowA shorthand property for the flexDirection and the flexWrap properties
flexGrowSets or returns how much the item will grow relative to the rest
flexShrinkSets or returns how the item will shrink relative to the rest
flexWrapSets or returns whether the flexible items should wrap or not
cssFloatSets or returns the horizontal alignment of an element
fontSets or returns fontStyle, fontVariant, fontWeight, fontSize, lineHeight, and fontFamily in one declaration
fontFamilySets or returns the font family for text
fontSizeSets or returns the font size of the text
fontStyleSets or returns whether the style of the font is normal, italic or oblique
fontVariantSets or returns whether the font should be displayed in small capital letters
fontWeightSets or returns the boldness of the font
fontSizeAdjustPreserves the readability of text when font fallback occurs
fontStretchSelects a normal, condensed, or expanded face from a font family
hangingPunctuationSpecifies whether a punctuation character may be placed outside the line box
heightSets or returns the height of an element
hyphensSets how to split words to improve the layout of paragraphs
iconProvides the author the ability to style an element with an iconic equivalent
imageOrientationSpecifies a rotation in the right or clockwise direction that a user agent applies to an image
isolationDefines whether an element must create a new stacking content
justifyContentSets or returns the alignment between the items inside a flexible container when the items do not use all available space.
leftSets or returns the left position of a positioned element
letterSpacingSets or returns the space between characters in a text
lineHeightSets or returns the distance between lines in a text
listStyleSets or returns listStyleImage, listStylePosition, and listStyleType in one declaration
listStyleImageSets or returns an image as the list-item marker
listStylePositionSets or returns the position of the list-item marker
listStyleTypeSets or returns the list-item marker type
marginSets or returns the margins of an element (can have up to four values)
marginBottomSets or returns the bottom margin of an element
marginLeftSets or returns the left margin of an element
marginRightSets or returns the right margin of an element
marginTopSets or returns the top margin of an element
maxHeightSets or returns the maximum height of an element
maxWidthSets or returns the maximum width of an element
minHeightSets or returns the minimum height of an element
minWidthSets or returns the minimum width of an element
navDownSets or returns where to navigate when using the arrow-down navigation key
navIndexSets or returns the tabbing order for an element
navLeftSets or returns where to navigate when using the arrow-left navigation key
navRightSets or returns where to navigate when using the arrow-right navigation key
navUpSets or returns where to navigate when using the arrow-up navigation key
objectFitSpecifies how the contents of a replaced element should be fitted to the box established by its used height and width
objectPositionSpecifies the alignment of the replaced element inside its box
opacitySets or returns the opacity level for an element
orderSets or returns the order of the flexible item, relative to the rest
orphansSets or returns the minimum number of lines for an element that must be left at the bottom of a page when a page break occurs inside an element
outlineSets or returns all the outline properties in one declaration
outlineColorSets or returns the color of the outline around a element
outlineOffsetOffsets an outline, and draws it beyond the border edge
outlineStyleSets or returns the style of the outline around an element
outlineWidthSets or returns the width of the outline around an element
overflowSets or returns what to do with content that renders outside the element box
overflowXSpecifies what to do with the left/right edges of the content, if it overflows the element's content area
overflowYSpecifies what to do with the top/bottom edges of the content, if it overflows the element's content area
paddingSets or returns the padding of an element (can have up to four values)
paddingBottomSets or returns the bottom padding of an element
paddingLeftSets or returns the left padding of an element
paddingRightSets or returns the right padding of an element
paddingTopSets or returns the top padding of an element
pageBreakAfterSets or returns the page-break behavior after an element
pageBreakBeforeSets or returns the page-break behavior before an element
pageBreakInsideSets or returns the page-break behavior inside an element
perspectiveSets or returns the perspective on how 3D elements are viewed
perspectiveOriginSets or returns the bottom position of 3D elements
positionSets or returns the type of positioning method used for an element (static, relative, absolute or fixed)
quotesSets or returns the type of quotation marks for embedded quotations
resizeSets or returns whether or not an element is resizable by the user
rightSets or returns the right position of a positioned element
scrollBehaviorSpecifies whether to smoothly animate the scroll position, instead of a straight jump, when the user clicks on a link within a scrollable boxt
tableLayoutSets or returns the way to lay out table cells, rows, and columns
tabSizeSets or returns the length of the tab-character
textAlignSets or returns the horizontal alignment of text
textAlignLastSets or returns how the last line of a block or a line right before a forced line break is aligned when text-align is "justify"
textDecorationSets or returns the decoration of a text
textDecorationColorSets or returns the color of the text-decoration
textDecorationLineSets or returns the type of line in a text-decoration
textDecorationStyleSets or returns the style of the line in a text decoration
textIndentSets or returns the indentation of the first line of text
textJustifySets or returns the justification method used when text-align is "justify"
textOverflowSets or returns what should happen when text overflows the containing element
textShadowSets or returns the shadow effect of a text
textTransformSets or returns the capitalization of a text
topSets or returns the top position of a positioned element
transformApplies a 2D or 3D transformation to an element
transformOriginSets or returns the position of transformed elements
transformStyleSets or returns how nested elements are rendered in 3D space
transitionA shorthand property for setting or returning the four transition properties
transitionPropertySets or returns the CSS property that the transition effect is for
transitionDurationSets or returns how many seconds or milliseconds a transition effect takes to complete
transitionTimingFunctionSets or returns the speed curve of the transition effect
transitionDelaySets or returns when the transition effect will start
unicodeBidiSets or returns whether the text should be overridden to support multiple languages in the same document
userSelectSets or returns whether the text of an element can be selected or not
verticalAlignSets or returns the vertical alignment of the content in an element
visibilitySets or returns whether an element should be visible
whiteSpaceSets or returns how to handle tabs, line breaks and whitespace in a text
widthSets or returns the width of an element
wordBreakSets or returns line breaking rules for non-CJK scripts
wordSpacingSets or returns the spacing between words in a text
wordWrapAllows long, unbreakable words to be broken and wrap to the next line
widowsSets or returns the minimum number of lines for an element that must be visible at the top of a page
zIndexSets or returns the stack order of a positioned element