我有一段代码,在Internet Explorer和Mozilla Firefox中运行正常,但在Google Chrome中失败了。这是基本的CSS :: selection选择器。
以下是问题的说明:
期望结果:(IE,Firefox)
有什么问题:(Chrome)
只有在Google Chrome中才会出现这种情况,我在此附上我尝试过的代码。
期望结果:(IE,Firefox)
![enter image description here](https://istack.dev59.com/KTxD8.webp)
![enter image description here](https://istack.dev59.com/9UCzu.webp)
::-moz-selection {
background-color: orange;
color: white;
}
::selection {
background-color: orange;
color: white;
}
::-webkit-selection {
background-color: orange;
color: white;
}
<ol>
<li>Hello World!</li>
<li>What's up?</li>
</ol>
#FFA500
而不是orange
。 - Sreelal P Mohan