configure @page print css

Asked

Viewed 1,571 times

0

People could help me with a CSS problem ( I believe ) because I can’t solve it myself.

as print below, when printing the page ALWAYS appears another blank just below. impressão com página á mais

my CSS

 html {
position: relative;
min-height: 100%;
 }
 html, body {
height: 54mm;
width: 101mm;
font: 14px arial, sans-serif;
writing-mode: tb-rl;
 }
 @page {
size: landscape;
margin-top: 0.0in;
margin-left: 0.03in;
margin-bottom: 0.0in;
margin-right: 0.03in;
 }
 .table {
border-collapse: collapse;
width: 100%;
 }

HTML:

 <table class="table">
<tr style="height: 95px">
     <td style="text-align: left; vertical-align: top; border-bottom: 1px solid #CDCDCD;">
    <div>
         <span>N&#176; A: <strong style="font-weight: 900;">123456789</strong></span><br />
         <span>N&#176; B: <strong style="font-weight: 900;">987456321</strong> </span><br />
         <span>Data Entrada: 18/12/2014</span><br />
         <span>Código: 0000</span>
    </div>
     </td>
     <td style="text-align: right; vertical-align: top; border-bottom: 1px solid #CDCDCD;">
<div style="position: absolute; right:-18px;"><img src="code128bar.jpg" style="vertical-align: middle; width:200px;"/></div>
     </td>
</tr>
<tr>
     <td colspan="2" style="text-align:left; vertical-align:top">
    <div>
         <span>Destinatário: <strong style="font-weight: 900;">FULANO DE TAL</strong></span><br />
         <span>Endereço: AV TESTE 1802</span><br />
         <span>Bairro: TESTE</span><br />
         <span>CEP: 99999-000</span><br />
         <span>SÃO PAULO - SP</span>
    </div>
     </td>
</tr>
 </table>
  • Looks like it’s a Google Chrome bug

  • @Wallacemaxters worse than in Mozilla also comes out 2

  • position: relative in html??? may be the case you set html, body {margin: 0; padding: 0}

1 answer

0


Solved

the problem was in that stretch

 html, body {
 height: 54mm;
 width: 101mm;
 font: 14px arial, sans-serif;
 writing-mode: tb-rl;
 }

Corrected

 html, body {
font: 14px arial, sans-serif;
writing-mode: tb-rl;
width: 381px;
 }
  • Was the time? Bigger than the page setting on the printer?

  • Yes @bfavaretto

  • @bfavaretto and can also be the margin that has not been zeroed in the html, body

Browser other questions tagged

You are not signed in. Login or sign up in order to post.