Tutorials References Exercises Videos Menu
Paid Courses Website NEW Pro NEW


JS Reference

JS by Category JS by Alphabet

JavaScript

JS Array JS Boolean JS Classes JS Date JS Error JS Global JS JSON JS Math JS Number JS Operators JS RegExp JS Statements JS String

Window

Window Object Window Console Window History Window Location Window Navigator Window Screen

HTML DOM

HTML Documents HTML Elements HTML Attributes HTML Events HTML Event Objects HTML Collection HTML NodeList HTML DOMTokenList HTML Styles
alignContent alignItems alignSelf animation animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationTimingFunction animationPlayState background backgroundAttachment backgroundColor backgroundImage backgroundPosition backgroundRepeat backgroundClip backgroundOrigin backgroundSize backfaceVisibility border borderBottom borderBottomColor borderBottomLeftRadius borderBottomRightRadius borderBottomStyle borderBottomWidth borderCollapse borderColor borderImage borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeft borderLeftColor borderLeftStyle borderLeftWidth borderRadius borderRight borderRightColor borderRightStyle borderRightWidth borderSpacing borderStyle borderTop borderTopColor borderTopLeftRadius borderTopRightRadius borderTopStyle borderTopWidth borderWidth bottom boxShadow boxSizing captionSide caretColor clear clip color columnCount columnFill columnGap columnRule columnRuleColor columnRuleStyle columnRuleWidth columns columnSpan columnWidth counterIncrement counterReset cssFloat cursor direction display emptyCells filter flex flexBasis flexDirection flexFlow flexGrow flexShrink flexWrap font fontFamily fontSize fontStyle fontVariant fontWeight fontSizeAdjust height isolation justifyContent left letterSpacing lineHeight listStyle listStyleImage listStylePosition listStyleType margin marginBottom marginLeft marginRight marginTop maxHeight maxWidth minHeight minWidth objectFit objectPosition opacity order orphans outline outlineColor outlineOffset outlineStyle outlineWidth overflow overflowX overflowY padding paddingBottom paddingLeft paddingRight paddingTop pageBreakAfter pageBreakBefore pageBreakInside perspective perspectiveOrigin position quotes resize right scrollBehavior tableLayout tabSize textAlign textAlignLast textDecoration textDecorationColor textDecorationLine textDecorationStyle textIndent textOverflow textShadow textTransform top transform transformOrigin transformStyle transition transitionProperty transitionDuration transitionTimingFunction transitionDelay unicodeBidi userSelect verticalAlign visibility width wordBreak wordSpacing wordWrap widows zIndex

Web APIs

API Console API Fullscreen API Geolocation API History API MediaQueryList API Storage

HTML Objects

<a> <abbr> <address> <area> <article> <aside> <audio> <b> <base> <bdo> <blockquote> <body> <br> <button> <canvas> <caption> <cite> <code> <col> <colgroup> <datalist> <dd> <del> <details> <dfn> <dialog> <div> <dl> <dt> <em> <embed> <fieldset> <figcaption> <figure> <footer> <form> <head> <header> <h1> - <h6> <hr> <html> <i> <iframe> <img> <ins> <input> button <input> checkbox <input> color <input> date <input> datetime <input> datetime-local <input> email <input> file <input> hidden <input> image <input> month <input> number <input> password <input> radio <input> range <input> reset <input> search <input> submit <input> text <input> time <input> url <input> week <kbd> <label> <legend> <li> <link> <map> <mark> <menu> <menuitem> <meta> <meter> <nav> <object> <ol> <optgroup> <option> <output> <p> <param> <pre> <progress> <q> <s> <samp> <script> <section> <select> <small> <source> <span> <strong> <style> <sub> <summary> <sup> <table> <tbody> <td> <tfoot> <th> <thead> <tr> <textarea> <time> <title> <track> <u> <ul> <var> <video>

Other References

CSSStyleDeclaration JS Conversion


HTML DOM Style Object


Style object

The Style object represents an individual style statement.

The Style object can be accessed from the document or from the elements to which that style is applied.

Syntax for using the Style object properties:

document.getElementById("id").style.property = "value"

The Style object property categories:


Background properties

Property Description
background Sets or returns all the background properties in one declaration
backgroundAttachment Sets or returns whether a background-image is fixed or scrolls with the page
backgroundColor Sets or returns the background-color of an element
backgroundImage Sets or returns the background-image for an element
backgroundPosition Sets or returns the starting position of a background-image
backgroundRepeat Sets or returns how to repeat (tile) a background-image

Border/Outline properties

Property Description
border Sets or returns border-width, border-style, and border-color in one declaration
borderBottom Sets or returns all the borderBottom* properties in one declaration
borderBottomColor Sets or returns the color of the bottom border
borderBottomStyle Sets or returns the style of the bottom border
borderBottomWidth Sets or returns the width of the bottom border
borderColor Sets or returns the color of an element's border (can have up to four values)
borderLeft Sets or returns all the borderLeft* properties in one declaration
borderLeftColor Sets or returns the color of the left border
borderLeftStyle Sets or returns the style of the left border
borderLeftWidth Sets or returns the width of the left border
borderRight Sets or returns all the borderRight* properties in one declaration
borderRightColor Sets or returns the color of the right border
borderRightStyle Sets or returns the style of the right border
borderRightWidth Sets or returns the width of the right border
borderStyle Sets or returns the style of an element's border (can have up to four values)
borderTop Sets or returns all the borderTop* properties in one declaration
borderTopColor Sets or returns the color of the top border
borderTopStyle Sets or returns the style of the top border
borderTopWidth Sets or returns the width of the top border
borderWidth Sets or returns the width of an element's border (can have up to four values)
outline Sets or returns all the outline properties in one declaration
outlineColor Sets or returns the color of the outline around a element
outlineStyle Sets or returns the style of the outline around an element
outlineWidth Sets or returns the width of the outline around an element

Generated Content Properties

Property Description
content Sets or returns the generated content before or after the element
counterIncrement Sets or returns the list of counters and increment values
counterReset Sets or returns the list of counters and their initial values

List properties

Property Description
listStyle Sets or returns list-style-image, list-style-position, and list-style-type in one declaration
listStyleImage Sets or returns an image as the list-item marker
listStylePosition Sets or returns the position of the list-item marker
listStyleType Sets or returns the list-item marker type

Margin/Padding properties

Property Description
margin Sets or returns the margins of an element (can have up to four values)
marginBottom Sets or returns the bottom margin of an element
marginLeft Sets or returns the left margin of an element
marginRight Sets or returns the right margin of an element
marginTop Sets or returns the top margin of an element
padding Sets or returns the padding of an element (can have up to four values)
paddingBottom Sets or returns the bottom padding of an element
paddingLeft Sets or returns the left padding of an element
paddingRight Sets or returns the right padding of an element
paddingTop Sets or returns the top padding of an element

Misc properties

Property Description
cssText Sets or returns the contents of a style declaration as a string

Positioning/Layout properties

Property Description
bottom Sets or returns the bottom position of a positioned element
clear Sets or returns the position of the element relative to floating objects
clip Sets or returns which part of a positioned element is visible
cssFloat Sets or returns the horizontal alignment of an element
cursor Sets or returns the type of cursor to display for the mouse pointer
display Sets or returns an element's display type
height Sets or returns the height of an element
left Sets or returns the left position of a positioned element
maxHeight Sets or returns the maximum height of an element
maxWidth Sets or returns the maximum width of an element
minHeight Sets or returns the minimum height of an element
minWidth Sets or returns the minimum width of an element
overflow Sets or returns what to do with content that renders outside the element box
position Sets or returns the type of positioning method used for an element (static, relative, absolute or fixed)
right Sets or returns the right position of a positioned element
top Sets or returns the top position of a positioned element
verticalAlign Sets or returns the vertical alignment of the content in an element
visibility Sets or returns whether an element should be visible
width Sets or returns the width of an element
zIndex Sets or returns the stack order of a positioned element

Printing properties

Property Description
orphans Sets or returns the minimum number of lines for an element that must be visible at the bottom of a page
pageBreakAfter Sets or returns the page-break behavior after an element
pageBreakBefore Sets or returns the page-break behavior before an element
pageBreakInside Sets or returns the page-break behavior inside an element
widows Sets or returns the minimum number of lines for an element that must be visible at the top of a page

Table properties

Property Description
borderCollapse Sets or returns whether the table border should be collapsed into a single border, or not
borderSpacing Sets or returns the space between cells in a table
captionSide Sets or returns the position of the table caption
emptyCells Sets or returns whether to show the border and background of empty cells, or not
tableLayout Sets or returns the way to lay out table cells, rows, and columns

Text properties

Property Description
color Sets or returns the color of the text
direction Sets or returns the text direction
font Sets or returns font-style, font-variant, font-weight, font-size, line-height, and font-family in one declaration
fontFamily Sets or returns the font family for text
fontSize Sets or returns the font size of the text
fontSizeAdjust Sets or returns the font aspect value
fontStyle Sets or returns whether the style of the font is normal, italic or oblique
fontVariant Sets or returns whether the font should be displayed in small capital letters
fontWeight Sets or returns the boldness of the font
letterSpacing Sets or returns the space between characters in a text
lineHeight Sets or returns the distance between lines in a text
quotes Sets or returns the type of quotation marks for embedded quotations
textAlign Sets or returns the horizontal alignment of text
textDecoration Sets or returns the decoration of a text
textIndent Sets or returns the indentation of the first line of text
textShadow Sets or returns the shadow effect of a text
textTransform Sets or returns the capitalization of a text
unicodeBidi Sets or returns whether the text should be overridden to support multiple languages in the same document
whiteSpace Sets or returns how to handle tabs, line breaks and whitespace in a text
wordSpacing Sets or returns the spacing between words in a text