I have two divs: div1 and div2.
Maintaining the original css styles applied to the div2 element being printed.
I don’t want to print content inside div1 but only the inside of div2.
How to print?
Advertisement
Answer
Try this
<style type="text/css">
@media print
{
body * { visibility: hidden; }
.div2 * { visibility: visible; }
.div2 { position: absolute; top: 40px; left: 30px; }
}
</style>