如题

解决方案 »

  1.   


    var margin = document.compatMode=="CSS1Compat" ? document.documentElement.style.margin : document.body.style.margin;
      

  2.   

    要在标签中写明了才能获得
    <body style="margin:20px">如果写在样式表中,那获得不了的

    <style>
    body{margin:20px;}
    </style>
      

  3.   

    var margin = document.compatMode=="CSS1Compat" ? document.documentElement.style.margin : document.body.style.margin;+1
    这个对。
      

  4.   

     style          标准的样式!可能是由style属性指定的! 
    runtimeStyle   运行时的样式!如果与style的属性重叠,将覆盖style的属性!
    currentStyle   指 style 和 runtimeStyle 的结合!