Go to comments

JavaScript中Css属性对照表

规律: "-"去掉,并把-后面的首字母换成大写 而且区分大小写

盒子标签和属性对照
CSS语法 (不区分大小写)JavaScript语法 (区分大小写)
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
floatfloatStyle
marginmargin
margin-bottommarginBottom
margin-leftmarginLeft
margin-rightmarginRight
margin-topmarginTop
paddingpadding
padding-bottompaddingBottom
padding-leftpaddingLeft
padding-rightpaddingRight
padding-toppaddingTop

颜色和背景标签和属性对照
CSS语法 (不区分大小写)JavaScript语法 (区分大小写)
backgroundbackground
background-attachmentbackgroundAttachment
background-colorbackgroundColor
background-imagebackgroundImage (backgroundImage="url(xxx.jpg)")
background-positionbackgroundPosition
background-repeatbackgroundRepeat
colorcolor

样式标签和属性对照
CSS语法 (不区分大小写)JavaScript语法 (区分大小写)
displaydisplay
list-style-typelistStyleType
list-style-imagelistStyleImage
list-style-positionlistStylePosition
list-stylelistStyle
white-spacewhiteSpace

文字样式标签和属性对照
CSS语法 (不区分大小写)JavaScript语法 (区分大小写)
fontfont
font-familyfontFamily
font-sizefontSize
font-stylefontStyle
font-variantfontVariant
font-weightfontWeight

文本标签和属性对照
CSS语法 (不区分大小写)语法 (区分大小写)
letter-spacingletterSpacing
line-breaklineBreak
line-heightlineHeight
text-aligntextAlign
text-decorationtextDecoration
text-indenttextIndent
text-justifytextJustify
text-transformtextTransform
vertical-alignverticalAlign
Leave a comment 0 Comments.

Leave a Reply

换一张