1)style只能获取行间样式(写在标签里面的);能读能写

2)currentStyle是专属ie的属性,区别他返回的是最终样式 及包括行间和外链css

3)getComputedStyle是一个可以获取当前元素所有最终使用的CSS属性值;只读

因此:

行间样式可以直接用style;其他可用函数

 var oStyle = this.currentStyle? this.currentStyle : window.getComputedStyle(this, null);
alert(oStyle.height);

.style, .getComputedStyle(),.currentStyle区别的更多相关文章

  1. style、currentStyle、getComputedStyle区别介绍

    style.currentStyle.getComputedStyle区别介绍 来自:蓝色天空 样式表有三种方式 内嵌样式(inline Style) :是写在Tag里面的,内嵌样式只对所有的Tag有 ...

  2. style、currentStyle、getComputedStyle(不同浏览器获取css样式)区别介绍

    style.currentStyle.getComputedStyle区别介绍   样式表有三种方式 内嵌样式(inline Style) :是写在Tag里面的,内嵌样式只对所有的Tag有效. 内部样 ...

  3. style currentStyle getComputedStyle的区别和用法

    先介绍下层叠样式表的三种形式: 1.内联样式,在html标签中style属性设置. <p style="color:#f90">内联样式</p> 2.嵌入样 ...

  4. getComputedStyle/currentStyle/style之间的爱恨情仇

    getComputedStyle是? getComputedStyle是一个可以获取当前元素所有最终使用的CSS属性值.返回的是一个CSS样式声明对象([object CSSStyleDeclarat ...

  5. JavaScript获取HTML元素样式的方法(style、currentStyle、getComputedStyle)

    一.style.currentStyle.getComputedStyle的区别 style只能获取元素的内联样式,内部样式和外部样式使用style是获取不到的. currentStyle可以弥补st ...

  6. obj.style 和currentstyle 等区别

    版权声明:本文为博主原创文章,未经博主允许不得转载. 获取样式  obj.style   和currentstyle  等区别   obj.style只能获得内嵌样式(inline Style)就是写 ...

  7. CSSOM之getComputedStyle,currentStyle,getPropertyValue,getAttribute

    js关于CSSOM编程的样式相关几个常用的方法 webkit:getComputedStyle,getPropertyValue IE:currentStyle,getAttribute 前言 jqu ...

  8. android 中theme.xml与style.xml的区别

    from://http://liangoogle.iteye.com/blog/1848448 android 中theme.xml与style.xml的区别: 相同点: 两者的定义相同. <r ...

  9. style,currentStyle,getComputedStyle的区别和用法

    先说说层叠样式表的三种形式(三种的叫法不一,按照各自的习惯): 一.内联样式:在HTML标签用style属性设置.如: 1 <p >这是内联样式</p> 二.嵌入样式:通过&l ...

随机推荐

  1. Semaphore用法

    HANDLE hSemaphore; cout<<1<<endl; hSemaphore = CreateSemaphore( NULL, 0, 10000, NULL);   ...

  2. QTP学习笔记之—VBS

    1.ToString() : Returns a string that represents the current test object. Example The following examp ...

  3. 一键安装lamp环境 centos

    linux centos yum安装LAMP环境 /*************链接**************/http://www.cnblogs.com/suger/p/3832093.html ...

  4. Lua面向对象----类、继承、多继承、单例的实现

    (本文转载)学习之用,侵权立删! 原文地址   http://blog.csdn.net/y_23k_bug/article/details/19965877?utm_source=tuicool&a ...

  5. 开发《基于Arcgis Online的家政管理服务信息系统》随笔2

    解决了三天的一个问题终于搞定了,和大家分享一下... 1.来点开胃菜,  在Sql server 2008中想要增加修改字段,有时不能修改,作如下操作即可搞定此问题, 启动MSSQL SERVER 2 ...

  6. js面向对象之创建对象

    工厂模式 function createPerson(name,age,job){ var o = new Object(); o.name = name; o.age = age; o.job = ...

  7. XidianOJ 1020 ACMer去刷题吧

    题目描述 刷题是每个ACMer必由之路,已知某oj上有n个题目,第i个题目小X能做对的概率为Pi(0<=Pi<=1,1<=i<=n) 求小X至少做对k道题的概率 输入 第一行输 ...

  8. [Qt系列] 何处下载,如何安装!

    时间:2016.07.29 -------------------------------------------- 其实方法有很多! 我的思路是想独立使用它,不想联合VS. 下载地址:http:// ...

  9. Content has been consumed

    if(response.getEntity() != null && response.getEntity().getContent() != null) { message = IO ...

  10. linux c学习笔记08--文件操作

    1 . 创建int creat(const char *filename, mode_t mode);参数 mode 指定新建文件的存取权限,它同 umask 一起决定文件的最终权限( mode&am ...