title: D3: adding style and class to DIV results in styles discarded
body: <p>I try to implement windows like interface for my d3-based project, but I have strange problem, when i add <code>class</code> attr to <code>DIV</code> and then try to control window position via <code>left, right</code> they are just ignored by d3 and style tag become empty for window <code>DIV</code>.</p>
  
  <p>All I need universal function to add and control windows position.</p>
  
  <p>I prepare <a href="https://jsfiddle.net/skyr9999/aewfn8kt/" rel="noreferrer">fiddle</a></p>
  
  <p>Here is a code:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var addWindow = function(parent, aClass, x, y, width, height) {
      var aWindow = d3.select(parent)
          .append("div")
          .attr("class", aClass)
          .style("top", y)
          .style("left", x)
          .style("width", width)
          .style("height", height);
  
      aWindow.append("div")
          .attr("class", "window-header-3d")
          .text("List");
  
      return aWindow;
  }
  
  persons_listbox = addWindow(".dia_body", "window-3d", 30, 30, 200, 300);
  
  //persons list
  persons_list = persons_listbox.append("ul").attr("class", "window-list-3d")
  
  
  persons_list.append("li").attr("class", "window-item-3d").text("11111");
  persons_list.append("li").attr("class", "window-item-3d").text("12111");
  persons_list.append("li").attr("class", "window-item-3d").text("13111");</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>body {
    background-color:rgba(50,50,50,1);   
  }
  
  .window-header-3d {
    width:100%;
    height:30px;
    border-radius:5px;
    background-color:rgba(250,250,250,1);
    z-index:1000;
    position:relative;
    padding-top:5px;
    padding-bottom:5px;
    text-align:center;
    margin-bottom:10px;
    border-bottom-right-radius: 0px;
    border-bottom-left-radius: 0px;
  }
  
  .window-item-3d {
    /*background-color: rgba(255, 255, 255, 1);*/
  }
  
  .window-list-3d {
    list-style: none;
    overflow-y: scroll;
    padding-left: 10px;
  }
  
  .window-3d {
    position:absolute;
    border:1px #ddd solid;
    border-radius:5px;
    background-color:rgba(255,255,255,0.5);
    z-index:1000;
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://d3js.org/d3.v3.min.js"&gt;&lt;/script&gt;
  &lt;div class="dia_body"&gt;&lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>SOLUTION: It actually all simple i just forgot add <code>px</code> for values. I updated fiddle to show how  it works.</p>