javascript - display content from specific div on print -


i want print content firefox. have inside html page <div id="printcontent"></div> hidden default. using css display div injected content on printing

@media print {         #printcontent{         display:block;     } } 

but on print preview i'm getting other page div, not #printcontent. should #printcontent on firefox print preview?

hide other content using display:none in media selector - i'd suggest #printcontent div child of body, can

@media print {         body>* {         display:none !important;     }     body>div#printcontent{         display:block !important;     } } 

edit: added !important - depending on other css may or may not need !important


Comments

Popular posts from this blog

android - Pass an Serializable object in AIDL -

php - Improving script execution time -

How to provide Authorization & Authentication using Asp.net, C#? -