Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/37.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Css 如何使用户选择在Safari浏览器中起作用_Css_Safari - Fatal编程技术网

Css 如何使用户选择在Safari浏览器中起作用

Css 如何使用户选择在Safari浏览器中起作用,css,safari,Css,Safari,我有这个html结构: <ol class="linenums"> <li class="L0"> <code> <span><!-- piece of code--></span> </code> </li> </ol> 在每个浏览器(即FF、Chrome、Opera)中,仅选择代码。除了在 游猎;根本不可能选择任何东西 我如何为

我有这个html结构:

<ol class="linenums">
   <li class="L0">
      <code>
          <span><!-- piece of code--></span>
      </code>
   </li>
</ol>
在每个浏览器(即FF、Chrome、Opera)中,仅选择代码。除了在 游猎;根本不可能选择任何东西


我如何为Safari做到这一点?

看来Safari也需要这一行:

-webkit-user-select: text;
因此,它现在正在使用以下代码:

ol.linenums li code {
  user-select: all;
  -webkit-user-select: text; /* Safari fallback only */
  -webkit-user-select: all; /* Chrome/Safari */
  -moz-user-select: all; /* Firefox */
  -ms-user-select: all; /* IE10+ */
}

对于像我这样的人,检查当前状态:确认自2021年起,safari和edge仍然需要前缀,并且不支持所有前缀
ol.linenums li code {
  user-select: all;
  -webkit-user-select: text; /* Safari fallback only */
  -webkit-user-select: all; /* Chrome/Safari */
  -moz-user-select: all; /* Firefox */
  -ms-user-select: all; /* IE10+ */
}