0





21

Advertisement

I am trying to style bootstrap modal for print.

The page opening modal has scroll and depending on scroll position, print preview gives extra margin on top.

Any suggestion or advice?

Question author Smchae | Source

Advertisement


0


The way I handled this was to add a class to background div before printing. Then in my styles I give display: none !important to that class in media query for print:

@media print { 
    /* All your print styles go here */
    .hide { display: none !important; } 
}

And before printing:

$("#divtohide").addClass("hide");

After printing:

$("#divtohide").removeClass("hide");
Answer author Yaser