CSS and JavaScript tags style property comparison table

Source: Internet
Author: User
Tags comparison table

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.