Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Chrome: Print preview differs from simulate CSS media print

I am having an issue when I print my page in Chrome 26 where tables appear with grey background colour.

When I view the page in chrome with simulated CSS media print it looks fine

in browser

when printing

When printing in Safari everything works fine. Anyone knows how to fix this issue?

like image 971
Christian R Avatar asked May 13 '13 19:05

Christian R


People also ask

How do you inspect element in print preview?

As of Chrome 48+, you can access the print preview via the following steps: Open dev tools – Ctrl/Cmd + Shift + I or right click on the page and choose 'Inspect'. Hit Esc to open the additional drawer.


2 Answers

Here is the solution: Add this to your print css

* {transition: none !important}

See: https://nicolasbouliane.com/blog/print-preview-significantly-different-inspector-chrome

like image 107
gco Avatar answered Nov 09 '22 12:11

gco


You can try -webkit-print-color-adjust:exact;, which overrides the setting where Chrome removes background colors. This could fix your problem.

like image 28
belens Avatar answered Nov 09 '22 10:11

belens