如果网站不需要阻止用户的选择内容的行为就可以使用如下样式:
* {
-webkit-user-select: text;
-user-select: text;
}
另一种方式:
*: not(input, textarea) {
-webkit - touch - callout: none;
-webkit - user - select: none;
}
最终的代码:
[contenteditable = "true"], input, textarea {
-webkit-user- select: auto!important;
-khtml-user-select: auto!important;
-moz-user-select: auto!important;
-ms-user-select: auto!important;
-o-user-select: auto!important;
user-select: auto!important;
}
https://www.cnblogs.com/mrnut/p/7656019.html