CMSCSS
CMSCSS

Reputation: 2176

@media print not working properly in Chrome

Have found/read/tried many answers on this so sorry if the solution has already been posted but Chrome is not displaying print styles correctly with many elements missing (but not all).

Here's how things are set up.

1. SETUP


2. TROUBLE SHOOTING


Any help or suggestions would be welcome.

Cheers

Ben

Upvotes: 4

Views: 12647

Answers (1)

DoctorDestructo
DoctorDestructo

Reputation: 4382

This problem is caused by the CSS declaration display: inline-block on your main content container class, presenter-notes__main-content.

An inline-block is essentially a block element on the inside and an inline element on the outside. An inline element is unbreakable in print unless it's line wrapped, in which case page breaks can only occur between lines. That prevents individual lines of text from getting split horizontally by page breaks, which would make the printed document very hard to read. An inline-block is never line wrapped (that's because its content wraps instead of the element itself), and thus is always unbreakable.

So, what happens when you have an element that's too large to fit on a single page, but can't be split across multiple pages? Crazy stuff, that's what! Sure, some browsers may degrade gracefully and just clip the overflow, but others may get confused and remove the element altogether. Computers aren't great at dealing with paradoxes.

Upvotes: 2

Related Questions