在手机浏览器中,长按可选中文本,但如果在应用中,会给人一种异样的感觉,最好还是禁用此功能。
1.安卓端:
在页面中添加如下样式即可:
*{ -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; }
2.IOS端:
如在IOS端添加跟安卓端相同的样式,会影响页面中input、textarea等元素的功能,所以需要跟安卓区分添加样式
*:not(input,textarea,select){ -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none; }