Chrome: Print preview differs from simulate CSS media print
Asked Answered
I

2

8

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?

Ilene answered 13/5, 2013 at 19:28 Comment(4)
You are defining that there should be no grey background in the Print Media declaration, right?Pyrology
Can we see some CSS code?Acidity
Thanks for the quick reply. I am using bootstrap css as is, with no mods. I am not explicitly declaring no grey background. Do I have to do this? I tried background-color:blue; but the table still appears grey in the print previewIlene
I have the same issue with margins. FF and IE print correctly. chrome emulation also. but chrome print output differs.Combination
C
7

Here is the solution: Add this to your print css

* {transition: none !important}

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

Combination answered 19/2, 2015 at 13:41 Comment(0)
C
2

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

Candice answered 13/5, 2013 at 23:37 Comment(1)
Doesn't seem to solve the issue unfortunately. I am still very confused why the print preview differs from the 'simulate CSS media print' setting. Shouldn't these be the same?Ilene

© 2022 - 2024 — McMap. All rights reserved.