I have td like this:
<td align="left" bgcolor="#FF0000">
In browsers, there is a red background color applied to it but when i see print preview of this, there is no red color in the background. also the font color is white but it also gets converted to white when print previewing it.
Anyone knows what can be the reason?
Thanks
To make WebKit browsers (Safari, Google Chrome) print the background image or color you should add the following css style to the element:
-webkit-print-color-adjust: exact;
The printing of background colors is supported differently by each browser, and it is often off by default. For instance, in Safari, it is an option in the print dialog called "Print Backgrounds". I am not sure where the option is in other browsers.
I just ran into this issue myself and believe I have a solution. I originally did this with an H1 tag but then used the same code for a TD
h1 {
background-color:#404040;
background-image:url("img/404040.png");
background-repeat:repeat;
box-shadow: inset 0 0 0 1000px #404040;
border:30px solid #404040;
height:0;
width:100%;
color:#FFFFFF !important;
margin:0 -20px;
line-height:0px;
}
Here are a couple things to note:
See my fiddle for a more detailed demonstration.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With