I have a div with white text color.
Using css media queries.
@media print {
.myid_print_duo_name
{
z-index: 2;
position: absolute;
left: 0px;
top: 330px;
width: 303px;
height: 28px;
line-height: 28px;
text-align: center;
color: white !important;
font-weight: bold;
font-size: 20px;
font-family: "Times New Roman";
}
}
My text looks like a little bit darker in my print preview.
I thought it was just ok, but then the printed result is really the same in my print preview. Why is it turning a little bit darker?
MDN Docs: Adding this below rule will overwrite the user's printer property settings.
@media print {
.myid_print_duo_name { /* Replace class_name with * to target all elements */
-webkit-print-color-adjust: exact;
color-adjust: exact; /* Non-Webkit Browsers */
}
}
Try this css, it may help you.
@media print {
.myid_print_duo_name{ -webkit-print-color-adjust: exact; color:#fff !important;}
}
Some browsers have a property called print-color-adjust
, which might darkening some colours and lightening others. Try adding these in your CSS:
-webkit-print-color-adjust: exact;
print-color-adjust: exact;
Taken from Smashing's website: http://www.smashingmagazine.com/2013/03/08/tips-and-tricks-for-print-style-sheets/
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