Have an application that draws div
s with background color as its graphics.
These divs appear fine on screen but the div
s disappear when printing to PDF.
Traced the problem to Twitter Bootstrap CSS. The divs print fine when Bootstrap CSS is not present. But don't print when it is. See this JSFiddle:
I think the problem is this section of Twitter CSS. I think I need to override the background: transparent !important
but can't for the life of me figure out how.
This is presumably simple. Tried background: opaque !important
but that didn't work, and I can't seem to find a list of allowable values for the background
property.
@media print {
* {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
box-shadow: none !important;
}
What's the opposite of background: transparent !important;
in CSS?
To keep the bootstrap.css untouched this is a way to win the 'who overwriting css slam' by inject media print css with jquery at bottom of head ...
The opposite of
background: transparent !important;
isbackground: color hex code !important;
"color hex code" can be any CSS acceptable color code type; like rgb, rgba, hexadecimal, etc.