欢迎您访问我爱IT技术网,今天小编为你分享的javascript教程:【js控制CSS样式属性语法对照表】,下面是详细的讲解!
js控制CSS样式属性语法对照表
| CSS语法 (不区分大小写) | JavaScript语法 (区分大小写) |
| border | border |
| border-bottom | borderBottom |
| border-bottom-color | borderBottomColor |
| border-bottom-style | borderBottomStyle |
| border-bottom-width | borderBottomWidth |
| border-color | borderColor |
| border-left | borderLeft |
| border-left-color | borderLeftColor |
| border-left-style | borderLeftStyle |
| border-left-width | borderLeftWidth |
| border-right | borderRight |
| border-right-color | borderRightColor |
| border-right-style | borderRightStyle |
| border-right-width | borderRightWidth |
| border-style | borderStyle |
| border-top | borderTop |
| border-top-color | borderTopColor |
| border-top-style | borderTopStyle |
| border-top-width | borderTopWidth |
| border-width | borderWidth |
| clear | clear |
| float | floatStyle |
| margin | margin |
| margin-bottom | marginBottom |
| margin-left | marginLeft |
| margin-right | marginRight |
| margin-top | marginTop |
| padding | padding |
| padding-bottom | paddingBottom |
| padding-left | paddingLeft |
| padding-right | paddingRight |
| padding-top | paddingTop |
| background | background |
| background-attachment | backgroundAttachment |
| background-color | backgroundColor |
| background-image | backgroundImage |
| background-position | backgroundPosition |
| background-repeat | backgroundRepeat |
| color | color |
| display | display |
| list-style-type | listStyleType |
| list-style-image | listStyleImage |
| list-style-position | listStylePosition |
| list-style | listStyle |
| white-space | whiteSpace |
| font | font |
| font-family | fontFamily |
| font-size | fontSize |
| font-style | fontStyle |
| font-variant | fontVariant |
| font-weight | fontWeight |
| letter-spacing | letterSpacing |
| line-break | lineBreak |
| line-height | lineHeight |
| text-align | textAlign |
| text-decoration | textDecoration |
| text-indent | textIndent |
| text-justify | textJustify |
| text-transform | textTransform |
| vertical-align | verticalAlign |
关于js控制CSS样式属性语法对照表的用户互动如下:
相关问题:js如何修改外部css样式表中的属性值
答:修改外面CSS的属性值,其目的是为了改变本HTML页面元素的样式,其实你干脆不如直接修改或者附加一个样式到本页面的HTML元素上(按照CSS的就近原则,直接写在HTML元素跟前的样式才是最终起作用的样式。) >>详细
相关问题:js如何添加CSS样式中的class添加属性
答:js不可修改css中的属性,只能为指定的class的元素添加内联样式(style) 原生JS: var dom = document.getElementsByClassName('dtd');for(var i=0,len=dom.length; i >>详细
相关问题:js怎么控制CSS3里的带有前缀的属性
答:楼上用的jQuery,我回答下js怎么做: 1、使用DOM获取到要修改的element,假设这个div的id=”container“: var elem = document.getElementById("container");2、修改elem的样式: elem.style.cssText = "-webkit-border-radius:50px";注意!getEl... >>详细
- 【Array】js中更短的 Array 类型转换-类型转换
- 【ExtJs】ExtJs 表单提交登陆实现代码-表单提交-
- 【Ajax】jQuery 学习第六课 实现一个Ajax的TreeVi
- 【extjs】extjs每个组件要设置唯一的ID否则会出错
- 【focus】JavaScript使用focus()设置焦点失败的解
- 【bootstrap3】基于bootstrap3和jquery的分页插件
- 【ajax】js获取通过ajax返回的map型的JSONArray的
- 【hover】jQuery控制图片的hover效果(smartRollo
- 【ajax更新数据库】ajax异步刷新实现更新数据库-
- 【div】div浮层 滚动条移动 位置保持不变的4种方
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
