Grey Font Color Printing

前端 未结 9 966
心在旅途
心在旅途 2020-12-14 00:21

Is there any way to ensure that my grey font colors do not turn black?

Firefox and Chrome seem to do this in order to prevent white text on black background from tur

9条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-14 01:02

    Nothing above was working for me so I finally figured it out.

    Always give colors to direct elements. Ex. Suppose your html is


    < h1>Text< /h1>

    and your CSS

    .div { 
         color: #ccc; 
        } 
    

    This was my case. In this case no matter what you do the color won't show.

    You have to do

    .div h1 { 
     color: #ccc; 
    }
    
    @media print { 
     .div h1 { 
        -webkit-print-color-adjust: exact; 
       } 
    }
    

    Hope this helps you!!

    Please reply if you find a better solution as this is what I could find after 2 hrs and it works for me.

提交回复
热议问题