0

When I define my CSS @media print rule (seen below), I am seeing a blank section at the top of my page in print preview (see image a blank section at top of page in print preview). I have tried setting the margin to lift the page and it skews the content. Ideas??

<style media="print">

body, body * {
    visibility: hidden;
    height: auto;
}

@@page {
    size: letter;
    margin:0;
    padding:0;
}


#card-body, #card-body * {
    visibility: visible;
}


</style>

<div id="card-body" class="border-grey-100 ">
        <div class="row ">
            <div class="col-lg-12">
                <h2 class="text-center">MEMORANDUM</h2>
                <h6 class="text-right" style="font-weight:bolder">REF NO. DHBC <span id="refNo"></span></h6>
                <table id="tbl_weeklyCollectionsData" style="border:0">
                </table>
            </div>
         </div>
</div>
Ggow Nick
  • 21
  • 5

1 Answers1

0

the solution was to not use visibility:hidden since that just hides the content and not remove it from the preview. So, use display:none on the content you wish to omit.

Ggow Nick
  • 21
  • 5