1

I m trying to print two shipping labels in one A4 sheet using @media query print css. Following is the code i'm trying but it is coming as one shipping label half in one sheet another one shipping label in another sheet. I need to fit in both the shipping labels in one A4 sheet.

Can someone pls help me or guide me how to do this, to fit two shipping labels in one A4 sheet using @media print css. Following is the code i m using.

<style media="print">
    .print { display:none; }
    body {
    width: 470px !important;
    height: 300px;
    margin-top: -270;
    margin-left: 100px;
    page-break-inside: avoid;
    }
</style>

thanks in advance...!!!!

Prasad
  • 61
  • 1
  • 4

1 Answers1

0

You're styling the body very small and you aren't using the @page CSS rule to define the page size, which may prove to be the problem. See here and here for other pages that might help you.

edit

You might also need to use page-break-inside, see this.

Community
  • 1
  • 1
ben3000
  • 4,629
  • 6
  • 24
  • 43
  • thanks for the answer but still not able to solve my problem here. I think i m missing something anyhow thanks for your suggestion – Prasad Dec 19 '15 at 07:01
  • What html and css are you using on the labels themselves? – ben3000 Dec 19 '15 at 07:03
  • it looks fine after entering ref no but i need it to be fine when i click on print... i m not getting it right after clicking on print preview. I m using html5 n css3 on the labels as well – Prasad Dec 19 '15 at 07:15