CSS: ::selection { background: #000000; color: #ffffff } not appearing as full black

爱⌒轻易说出口 提交于 2019-12-23 09:49:33

问题


::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;
}


来源:https://stackoverflow.com/questions/8372334/css-selection-background-000000-color-ffffff-not-appearing-as-full-b

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!