CSS和Javascript的标签属性对应表
在写javascript中,经常要用到style对象的css属性,很多不记得
其实很好记,基本就是CSS中的“-”转化为javascript的驼峰写法,除了注意下float
| 盒子标签和属性对照 |
|---|
| CSS语法(不区分大小写) |
| border |
| border-bottom |
| border-bottom-color |
| border-bottom-style |
| border-bottom-width |
| border-color |
| border-left |
| border-left-color |
| border-left-style |
| border-left-width |
| border-right |
| border-right-color |
| border-right-style |
| border-right-width |
| border-style |
| border-top |
| border-top-color |
| border-top-style |
| border-top-width |
| border-width |
| clear |
| float |
| margin |
| margin-bottom |
| margin-left |
| margin-right |
| margin-top |
| padding |
| padding-bottom |
| padding-left |
| padding-right |
| padding-top |
| 颜色和背景标签和属性对照 |
| CSS 语法(不区分大小写) |
| background |
| background-attachment |
| background-color |
| background-image |
| background-position |
| background-repeat |
| color |
| 样式标签和属性对照 |
| CSS语法(不区分大小写) |
| display |
| list-style-type |
| list-style-image |
| list-style-position |
| list-style |
| white-space |
| 文字样式标签和属性对照 |
| CSS 语法(不区分大小写) |
| font |
| font-family |
| font-size |
| font-style |
| font-variant |
| font-weight |
| 文本标签和属性对照 |
| CSS 语法(不区分大小写) |
| letter-spacing |
| line-break |
| line-height |
| text-align |
| text-decoration |
| text-indent |
| text-justify |
| text-transform |
| vertical-align |
**提示:
**CSS中的float属性是个例外,因为float是javascript的保留关键字,在IE中使用的是styleFloat,而其他浏览器则使用cssFloat.





