Make all parents visible
I've struggled some hours with this and finally noticed the problem was that some of the parent tags where preventing the div to be fully visible, and instead a scrollbar from some parent tags was being visible on the print.
So the final effective solution was to apply all the rules (mentioned in other answers) to all possible parent tags that could be in the middle, including also an !important
rule so they wouldn't be bypassed.
Like this:
@media print { body, .CLASS-of-parent-tag, #ID-of-div-with-long-content { display: block !important; position: relative !important; width: auto !important; height: auto !important; overflow: visible !important; margin-left: 0 !important; }}
This applies for almost any case in my projects.