Using break-inside should work:
@media print {
div {
break-inside: avoid;
}
}
It works on all major browsers:
- Chrome 50+
- Edge 12+
- Firefox 65+
- Opera 37+
- Safari 10+
Using page-break-inside: avoid;
instead should work too, but has been exactly deprecated by break-inside: avoid
.