CSS ::选择在Google Chrome中不起作用

ode*_*dta 5 html css html5

我有这段代码,可以在Internet Explorer和Mozilla Firefox中正常运行,但是在Google Chrome上却无法运行,这是基本的CSS ::selection选择器。随附的是该问题的说明:

所需结果:(IE,Firefox)
在此处输入图片说明

怎么了:(Chrome)
在此处输入图片说明

这仅在Google Chrome浏览器中发生,我将在此处尝试的代码附加为:

::-moz-selection {
  background-color: orange;
  color: white;
}
::selection  {
  background-color: orange;
  color: white;
}
::-webkit-selection {
  background-color: orange;
  color: white;
}
Run Code Online (Sandbox Code Playgroud)
<ol>
  <li>Hello World!</li>
  <li>What's up?</li>
</ol>
Run Code Online (Sandbox Code Playgroud)

Muh*_*met 5

::-webkit-selection 似乎没有解决问题,但还有另一种解决方法:

::-moz-selection {
  background-color: orange;
  color: white;
}
::selection {
  background-color: orange;
  color: white;
}
ol {
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
ol span {
  -webkit-user-select: all;
  -moz-user-select: all;
  -ms-user-select: all;
}
Run Code Online (Sandbox Code Playgroud)
<ol>
  <li><span>Hello World!</span></li>
  <li><span>What's up?</span></li>
</ol>
Run Code Online (Sandbox Code Playgroud)