手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >javascript css float属性的特殊写法
javascript css float属性的特殊写法
摘要:1、对于没有中划线的css属性一般直接使用style.属性名即可。如:obj.style.margin,obj.style.width,ob...

1、对于没有中划线的css属性一般直接使用style.属性名即可。

如:obj.style.margin,obj.style.width,obj.style.left,obj.style.position等。

2、对于含有中划线的css属性,将每个中划线去掉并将每个中划线后的第一个字符换成大写即可。

如:obj.style.marginTop,obj.style.borderLeftWidth,obj.style.zIndex,obj.style.fontFamily等。

这个规律我想大多数的前端开发者也都熟知。对在css中有一个特殊的属性其js使用方法确比较特殊。

这个特殊的属性就是:float。我们不能直接使用obj.style.float来使用,这样操作是无效的。

其正确的使用方法是为:(IE、Opera):obj.style.styleFloat,其他浏览器(Firefox):obj.style.cssFloat

【javascript css float属性的特殊写法】相关文章:

javascript下操作css的float属性的特殊写法

javascript的函数第1/3页

javascript中一些util方法汇总

javascript改变和控制显示的图片大小

javascript实现控制的多级下拉菜单

Javascript 字符串模板的简单实现

JavaScript中Math.SQRT2属性的使用详解

javascript的事件描述

JavaScript中的Math.E属性使用详解

javascript中CheckBox全选终极方案

精品推荐
分类导航