H50060:html 禁止长按选中文字

1,

解决方案:

 直接在CSS 文件中添加下面的代码,就可以实现了在手机端禁止粘贴复制的功能:

*{
    -webkit-touch-callout:none;  /*系统默认菜单被禁用*/
    -webkit-user-select:none; /*webkit浏览器*/
    -khtml-user-select:none; /*早期浏览器*/
    -moz-user-select:none;/*火狐*/
    -ms-user-select:none; /*IE10*/
    user-select:none;
}

在添加完这段代码后,在IOS 上会有问题的,这个时候你会发现input 框无法正在输入了内容了;造成这个原因就是 -webkit-user-select:none; 这个属性造成的。

解决这个方法 就是 在css 文件中同时设置一下input 的属性,如下所示:

input {
     -webkit-user-select:auto; /*webkit浏览器*/
}
琥珀君的博客
原文地址:https://www.cnblogs.com/eliteboy/p/13618988.html