CSS and JavaScript tags style property comparison table
The general situation is to remove the word "-" and capitalize the second letter.
CSS syntax (case-insensitive) JavaScript syntax (casing-sensitive)
Borderborder
Border-bottomborderbottom
Border-bottom-colorborderbottomcolor
Border-bottom-styleborderbottomstyle
Border-bottom-widthborderbottomwidth
Border-colorbordercolor
Border-leftborderleft
Border-left-colorborderleftcolor
Border-left-styleborderleftstyle
Border-left-widthborderleftwidth
Border-rightborderright
Border-right-colorborderrightcolor
Border-right-styleborderrightstyle
Border-right-widthborderrightwidth
Border-styleborderstyle
Border-topbordertop
Border-top-colorbordertopcolor
Border-top-stylebordertopstyle
Border-top-widthbordertopwidth
Border-widthborderwidth
clearclear
floatfloat//stylefloat (IE)/cssFloat (FireFox)
Marginmargin
Margin-bottommarginbottom
margin-leftmarginleft
Margin-rightmarginright
Margin-topmargintop
paddingpadding
Padding-bottompaddingbottom
Padding-leftpaddingleft
Padding-rightpaddingright
Padding-toppaddingtop
Color and background labels and attribute comparisons
Backgroundbackground
Background-attachmentbackgroundattachment
Background-colorbackgroundcolor
Background-imagebackgroundimage
Background-positionbackgroundposition
Background-repeatbackgroundrepeat
Colorcolor
Style label and attribute control
Displaydisplay
List-style-typeliststyletype
List-style-imageliststyleimage
List-style-positionliststyleposition
List-styleliststyle
White-spacewhitespace
Text style labels and attribute comparisons
Fontfont
Font-familyfontfamily
Font-sizefontsize
Font-stylefontstyle
Font-variantfontvariant
Font-weightfontweight
Text label and attribute comparison
Letter-spacingletterspacing
Line-breaklinebreak
Line-heightlineheight
Text-aligntextalign
Text-decorationtextdecoration
Text-indenttextindent
Text-justifytextjustify
Text-transformtexttransform
Vertical-alignverticalalign
Add:
Style gets the inline style, which is the value in the Style property, which you can use to change the element display style
Currentstyle only IE and Opera support, get HtmlElement's computed style, not supported in other browsers
getComputedStyle is used in standard browsers, IE9 also supports getComputedStyle, but is not fully supported, such as border
var element = document.getElementById ("id");
var currentstyle = Element.currentstyle? Element.currentStyle:window.getComputedStyle (element, NULL);
var float = currentstyle.getpropertyvalue ("float")//float a simple way for legacy browsers to remain compatible
CSS and JavaScript tags style property comparison table