title: Print Javascript is blank with Display : block/none
body: <p>Someone in this forum help me for Print a div with Javascript.
  But when a put Display none for the content that I don't want and display block for the div i want print, my print function show me a blank page.</p>
  
  <p>But if i put Visibility : Hidden/Visible, my print work but i got my result with many white page cause of the Viability only is hidden</p>
  
  <p>I do a code pen : 
  <a href="http://codepen.io/anon/pen/gMYMBB" rel="nofollow">enter link description here</a></p>
  
  <p>My CSS : `  </p>
  
  <pre><code>body * {
      display: none !important;
    }
    .print-div, .print-div * {
      display: block !important;
    }`
  </code></pre>
  
  <p>Javascript </p>
  
  <pre><code>    function addPrintClassAndPrintDiv(divId) {
  
     //remove .print-div class from all element if any 
       $(".print-div").removeClass("print-div"); 
  
     //add .print-div class to that div you want to print
       $("#"+divId).addClass("print-div");
  
     //print 
        window.print();
  }
  </code></pre>
  
  <p>So I want the possibility of print any div and the result is print each div in one page only </p>
  
  <p>Thanks you !</p>