Created
December 5, 2020 20:55
-
-
Save ps2goat/de7db5295fc70c2fd642e96509c3a593 to your computer and use it in GitHub Desktop.
Shrink whitespace for printouts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* place in a the head tag of html | |
It will remove all ridiculous page break directions, overflows, and inline-block display types, which cause issues. | |
Then re-applies hiding to elements that need it. could be better but works /shrug | |
Originally used on a health site's receipt page that was 3 pages long but should have fit on 1 page at 100% scale. | |
*/ | |
<style type="text/css"> | |
@media print { | |
* { | |
page-break-before: avoid!important; | |
page-break-after: avoid!important; | |
overflow: auto!important; | |
display:inline!important; | |
} | |
head, link, style, script { | |
visibility:hidden!important; | |
display: none!important; | |
} | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment