CSS selection color behaving strangely on Chrome

后端 未结 3 722
傲寒
傲寒 2021-01-05 12:32

I\'m trying to change the selection color of my website using the CSS ::selection pseudoelement.

As seen in this jsFiddle, the text is supposed to hav

3条回答
  •  有刺的猬
    2021-01-05 13:10

    Possibly to prevent exactly what you are trying to do, it seems like Chrome will change the opacity of the background color of the selection if it's 1. You can cheat this by setting the opacity very close to 1 like (background-color: rgba(0,0,0,.99).

    http://jsfiddle.net/ExplosionPIlls/a3gfR/5/

提交回复
热议问题