-->

CSS: ::selection { background: #000000; color: #ff

2019-06-21 04:40发布

问题:

::selection { background: #000000; color: #ffffff } 

Is resulting in a dark grey selection color, not full black (#000000). Changing opacity makes no difference.

How do I make the selection color appear as #ffffff?

回答1:

This worked for me:

::selection {
   background: rgba(0, 0, 0, 0.99);
   color: #FFF;
}


回答2:

I had the same problem, I had to change the code to background-color instead since the above solution did not work for me.

::selection {
    background-color: #000000;
    color: #FFF;
}