title: Php dompdf doesnt work with css
body: <p>I try to generate pdf from html with css styles , </p>
  
  <p>I use dompdf for this.
  In css there are floats too.</p>
  
  <p>This is my css and html code:</p>
  
  <pre><code>$dompdf = new DOMPDF();  //create object 
  //load html with css
  $dompdf-&gt;loadHtml('&lt;html&gt;
  &lt;head&gt;
  &lt;style&gt;
  #first_head,#second_head,#content_invoice{width: 100%;}
  .has-65 {
      width: 65%;
      float:left;
  }
  #product_invoice_table tr th:last-child, #product_invoice_table tr td:last-child {
      text-align: right;
  }
  .has-35 {
      width: 35%;
      float:right;
  }
  .has-55 {
      width: 55%;
  }
  .has-45 {
      width: 45%;
  }
  .clearFix{
      float:none;
      clear:both;
  }
  #second_head{
      margin-top: 100px;
  }
  
  #template_invoice{
      padding: 50px 80px 50px 80px;
      margin: 0 auto;
      margin-top: 30px;
      margin-bottom: 30px;
      font-size: 20px;
      color: #000!important;
      font-family: Arial,serif!important;
  }
  #content_invoice{
      width: 100%;
      float: left;
      margin-top: 150px;
  }
  
  #product_total_info{
      float: right;
      margin-top: 100px;
  }...
  &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;div id="template_invoice"&gt;
      &lt;div id="first_head"&gt;
          &lt;div id="logo_invoice" class="has-65"&gt;
              &lt;img src="logo.PNG" width="280px"&gt;
          &lt;/div&gt;
          &lt;div id="main_header_info" class="has-35"&gt;
         mandelaugengroup gmbh
  Schaffhauserstrasse 611
  CH - 8052 Zürich
  Tel.: +41 79 205 05 05
  info@babboe.ch
  www.babboe.ch
  MWST/UID-Nr. CHE-254.427.754
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="clearFix"&gt;&lt;/div&gt;
      &lt;div id="second_head"&gt;
          &lt;div id="lead_address" class="has-65"&gt;
              &lt;span id="lead_name"&gt;ghmgmgm&lt;/span&gt;&lt;br&gt;
              &lt;span id="lead_street"&gt;mhgmhm&lt;/span&gt;&lt;br&gt;
              &lt;span id="lead_postcode_city"&gt;mbmbmjggjg&lt;/span&gt;&lt;br&gt;
          &lt;/div&gt;
           &lt;div id="lead_invoice_info" class="has-35"&gt;
              &lt;div class="span_padding_invoice"&gt;
              &lt;span class="invoice_main_span"&gt;Rechnungs-Nr.&lt;/span&gt;
              &lt;span id="lead_rechnungs_nr" class="right-clmn-span"&gt;jghghjgh&lt;/span&gt;
              &lt;br&gt;
              &lt;/div&gt;
              &lt;div class="span_padding_invoice"&gt;
              &lt;span class="invoice_main_span"&gt;Kunden-Nr.&lt;/span&gt;
              &lt;span id="lead_kunder_nr" class="right-clmn-span"&gt;ghjgvj&lt;/span&gt;
              &lt;br&gt;
                  &lt;/div&gt;
              &lt;div class="span_padding_invoice"&gt;
              &lt;span class="invoice_main_span"&gt;Datum&lt;/span&gt;
              &lt;span id="invoice_datum" class="right-clmn-span"&gt;hhhhhhh&lt;/span&gt;
              &lt;br&gt;
                  &lt;/div&gt;
              &lt;div class="span_padding_invoice"&gt;
              &lt;span class="invoice_main_span"&gt;Fallig am&lt;/span&gt;
              &lt;span id="invoice_falling_am" class="right-clmn-span"&gt;bjbbb&lt;/span&gt;
              &lt;br&gt;
                  &lt;/div&gt;
              &lt;div class="span_padding_invoice lead_total_container"&gt;
                  &lt;span class="invoice_main_span total_bold"&gt;Total&lt;/span&gt;
                  &lt;span id="lead_total" class="right-clmn-span"&gt;iljkkj&lt;/span&gt;
                  &lt;br&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div id="content_invoice"&gt;
      ...
          &lt;table id="product_invoice_table" width="100%"&gt;
        ....
          &lt;/table&gt;
       &lt;/div&gt;
       &lt;div class="has-65"&gt;&lt;/div&gt;
     &lt;div id="product_total_info" class="has-35"&gt;
          &lt;div class="span_padding_invoice lead_total_container"&gt;
          &lt;span class="invoice_main_span"&gt;Total exkl.MWST&lt;/span&gt;
          &lt;span class="right-clmn-span"&gt;CHF &lt;span id="total_sum"&gt;&lt;/span&gt;&lt;/span&gt;
          &lt;/div&gt;
          &lt;div class="span_padding_invoice"&gt;
          &lt;span class="invoice_main_span" id="mwst_num"&gt;&lt;/span&gt;
          &lt;span class="right-clmn-span"&gt;CHF &lt;span id="total_percant"&gt;&lt;/span&gt;&lt;/span&gt;
          &lt;br&gt;
              &lt;/div&gt;
          &lt;div class="span_padding_invoice lead_total_container_bold"&gt;
          &lt;span class="invoice_main_span"&gt;Total&lt;/span&gt;
          &lt;span class="right-clmn-span"&gt;CHF &lt;span id="total_end"&gt;&lt;/span&gt;&lt;/span&gt;
              &lt;br&gt;
              &lt;/div&gt;
      &lt;/div&gt;
      &lt;div id="footer_invoice"&gt;
    ...
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;');
  $dompdf-&gt;render();
  $dompdf-&gt;stream("hello.pdf");
  </code></pre>
  
  <p>But my css doesnt work good. I add css as  .
  I get this result:</p>
  
  <p><a href="https://i.stack.imgur.com/WWBsf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WWBsf.png" alt="result"></a></p>
  
  <p>So how can I solve this problem?
  Maybe I must set some settings for my css or settinhs for page?
  Thanks for any help.</p>