Reputation: 1234
div {
background-color: #dcdcdc;
}
The above has a nice gray color on screen but when I try to print it, it results in a white. How do I fix this?
Upvotes: 3
Views: 838
Reputation: 2911
Use color-adjust in your CSS to tell the user agent to print background colours:
div {
-webkit-print-color-adjust: exact !important;
background-color:#dcdcdc !important;
}
You might also need to enable background graphics in your printing settings in your browser. In Chrome it's
Upvotes: 5