CSS和Js样式属性的对照关系
注意:1、在使用js时,如newTD.style.paddingLeft="200";(错误),正确生效的写法是newTD.style.paddingLeft="200px";(正确),不可少了px,否则不会生效。
背景:用户说拿Jquery做图片缩放旋转裁剪效率底下,于是想到了可以用css3的style来做,或者用canvas标签,
IE10内核,微信内核,chrome内核,safari内核对css3支持好像不太一样,我擦,搞死人。
| 盒子标签和属性对照 | |
|---|---|
| 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 |
| 颜色和背景标签和属性对照 | |
| CSS 语法(不区分大小写) | JavaScript 语法(区分大小写) |
| background | background |
| background-attachment | backgroundAttachment |
| background-color | backgroundColor |
| background-image | backgroundImage |
| background-position | backgroundPosition |
| background-repeat | backgroundRepeat |
| color | color |
| 样式标签和属性对照 | |
| CSS语法(不区分大小写) | JavaScript 语法(区分大小写) |
| display | display |
| list-style-type | listStyleType |
| list-style-image | listStyleImage |
| list-style-position | listStylePosition |
| list-style | listStyle |
| white-space | whiteSpace |
| 文字样式标签和属性对照 | |
| CSS 语法(不区分大小写) | JavaScript 语法(区分大小写) |
| font | font |
| font-family | fontFamily |
| font-size | fontSize |
| font-style | fontStyle |
| font-variant | fontVariant |
| font-weight | fontWeight |
| 文本标签和属性对照 | |
| CSS 语法(不区分大小写) | JavaScript 语法(区分大小写) |
| 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 |
| html中td.class="aaa" | td.className="aaa" |
| CSS3 | JavaScript |
| box-shadow | elemmnt.style.webkitBoxShadow |
| transform | elemmnt.style.webkitTransform |
| transform:translate | elemmnt.style.webkitTransform = “translate(px,px)”; |
| transform:scale | elemmnt.style.webkitTransform = “scale(x,y)”; |
| transform:rotate | elemmnt.style.webkitTransform = “rotate(deg)”; |
| transform:skew | elemmnt.style.webkitTransform = “skew(deg)”; |
| transform-origin | elemmnt.style.webkitTransformOrigin |
| transform-style | elemmnt.style.webkitTransformStyle |
| transition-property | elemmnt.style.webkitTransformProperty |
| transition-duration | elemmnt.style.webkitTransitionDuration |
| transition-timing-function | elemmnt.style.webkitTransitionTimingFunction |
| transition-delay | elemmnt.style.webkitTransitionDelay |
| animation-name | elemmnt.style.webkitAnimationName |
| animation-duration | elemmnt.style.webkitAnimationDuration |
| animation-timing-function | elemmnt.style.webkitAnimationTimingFunction |
| animation-iteration-count | elemmnt.style.webkitAnimationIterationCount |
| animation-direction | elemmnt.style.webkitAnimationDirection |
| animation-play-state | elemmnt.style.webkitAnimationPlayState |
| animation-delay | elemmnt.style.webkitAnimationDelay |
|
background linear-gradient |
elemmnt.style.background = “-webkit-gradient(linear, ~~)”; |
| background radial-gradient | elemmnt.style.background = “-webkit-gradient(radial, ~~)”; |
| text-shadow | elemmnt.style.textShadow |
| box-sizing | elemmnt.style.webkitBoxSizing |
| border-radius | elemmnt.style.webkitBorderRadius |
| border-top-left-radius | elemmnt.style.webkitBorderTopLeftRadius |
| border-top-right-radius | elemmnt.style.webkitBorderTopRightRadius |
| border-bottom-left-radius | elemmnt.style.webkitBorderBottomLeftRadius |
| border-bottom-right-radius | elemmnt.style.webkitBorderBottomRightRadius |
| border-image | elemmnt.style.webkitBorderImage |
| border-image-source | elemmnt.style.webkitBorderImageSource |
| border-image-slice | elemmnt.style.webkitBorderImageSlice |
| border-image-width | elemmnt.style.webkitBorderImageWidth |
| border-image-outset | elemmnt.style.webkitBorderImageOutset |
| border-image-repeat | elemmnt.style.webkitBorderImageRepeat |
CSS和Js样式属性的对照关系的更多相关文章
- CSS和JS样式属性对照表
注意:1.CSS中的float属性是个例外,因为float是javascript的保留关键字,在IE中使用的是styleFloat,而其他浏览器则使用cssFloat. 盒子标签和属性对照 CSS语法 ...
- IT兄弟连 HTML5教程 CSS3揭秘 CSS常见的样式属性和值1
CSS中的样式属性比较多,经常使用的属性可以分为这么几类:字体.文本.背景.位置.边框.列表,以及其他一些样式属性.每个类中的属性都可以单独使用:如果同一个类中多个属性一起使用,还可以将它们整合为一行 ...
- CSS控制列表样式属性list-style有哪些?怎么用?
CSS列表样式属性list-style有哪些类型?不同类型CSS控制列表样式使用时该注意什么? 这是W3Cschool用户Shirley于2016-11-10在W3Cschool编程问答提出的问题.云 ...
- SpringMVC配置了拦截器(interceptors)却显示不出css、js样式的解决办法
首先因为在web.xml里面配置了 <filter-mapping> <filter-name>characterEncodingFilter</filter-name& ...
- IT兄弟连 HTML5教程 CSS3揭秘 CSS常见的样式属性和值4
6 鼠标光标属性 在网页中默认的鼠标指针只有两种,一种是最普通的箭头,另一种是当移动到链接上时出现的“小手”.但现在越来越多的网页都使用了CSS鼠标指针技术,当将鼠标移动到链接上时,可以看到多种不同 ...
- 今天写了一个SSM小项目,运行之后,前端页面的CSS、js样式显示不出来,具体操作如下:
因为SSM中我们设置了拦截器,拦截器会拦截CSS和JS,所有样式渲染不出来,在Web.xml中写上 1 <servlet-mapping> 2 <servlet-name>de ...
- HTML、CSS、JS 样式 (未整理)
随手记,有错误的地方希望留言 ^.-.^ PHP 实现关闭浏览器窗口echo "<script>window.close();</script>"; jqu ...
- IT兄弟连 HTML5教程 CSS3揭秘 CSS常见的样式属性和值2
3 背景属性 大多数HTML元素都允许控制背景,包括背景颜色.背景图像.背景重复.背景附件.背景位置等属性.常见的控制背景属性.值及描述如表2所示. 表2 CSS中常见的控制背景的属性 除了使用表 ...
- iOS实现 webView loadHTMLString加载外部css、js样式
记录一下. webview(或wk)用 loadHTMLString加载内容时 ,如果只是单纯的html内容,样式等都写在内部,直接设置baseURL为nil即可. 不过当html里包含外部样式或调用 ...
随机推荐
- node crypto md5加密,并解决中文不相同的问题
在用crypto模块时碰到了加密中文不相同的问题,多谢群里面@蚂蚁指定 1:解决中文不同的问题 function md5Pay(str) { str = (new Buffer(str)).toStr ...
- UINavigation Bar中使用UIcollectionView,在UIcollectionView的顶端和低端出现空白的问题
在含有UINavigation Bar的视图中,使用UIcollectionView,会在UIcollectionView的顶端和低端出现空白,需要添加下面 一句代码,空白即可消失 //如果不加这 ...
- WIN2008 R2 安装SQLSERVER2008笔记
系统升级到SERVER2008R2 有些地方和WIN2003区别很大 这里记下 1.IIS 2008已经自带了不需要再额外找安装包或者系统盘安装 只需要打开服务管理器“角色”中添加”“web服务器(I ...
- iOS应用架构谈 view层的组织和调用方案
当我们开始设计View层的架构时,往往是这个App还没有开始开发,或者这个App已经发过几个版本了,然后此时需要做非常彻底的重构. 一般也就是这两种时机会去做View层架构,基于这个时机的特殊性,我们 ...
- python file模块 替换输入内容脚本
root@python-10:/home/liujianzuo/python/test# ls passwd rc.local test1 root@python-10:/home/liujianzu ...
- iOS解析JSON字符串报错Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence around character 586."
将服务器返回的JSON string转化成字典时报错: Error Domain=NSCocoaErrorDomain Code=3840 "Invalid escape sequence ...
- linux command screen
喜欢这句话 “我们永远相信,分享是一种美德 | We Believe, Great People Share Knowledge...” 但是这种美德不是为什么都要问的人准备的 ——————————— ...
- 让Placeholder在IE中燥起来
网上有好多关于这方面解决兼容性问题的文章,很多招式,学会这一招,让你轻松搞定Placeholder的兼容性,叫我好人,拿走,不谢.... placeholder属性是HTML5 中为input添加的. ...
- .net 直接输出远程文件到浏览器和下载文件保存到本机
利用了xmlhttp,实现代码比较简单具体实现如下: 首先bin文件引入,com->microsoft xml v3.0 具体代码如下: protected void Button1_Click ...
- HTML5 UI框架Kendo UI Web教程:创建自定义组件(三)
Kendo UI Web包 含数百个创建HTML5 web app的必备元素,包括UI组件.数据源.验证.一个MVVM框架.主题.模板等.在前面的2篇文章<HTML5 Web app开发工具Ke ...