有时候操作H5页面需要长按某个按钮的时候,会出现浏览器系统自带的复制功能很烦,怎么解决呢,只需要加入以下样式。
body {
-webkit-touch-callout:
none;
/*系统默认菜单被禁用*/
-webkit-user-select:
none;
/*webkit浏览器*/
-khtml-user-select:
none;
/*早起浏览器*/
-moz-user-select:
none;
/*火狐浏览器*/
-ms-user-select:
none;
/*IE浏览器*/
user-select:
none;
/*用户是否能够选中文本*/
}
但是在输入框input select 不能输入文子,所以还需要加入一些允许他们输入的样式
input,select {
-webkit-user-select:
auto;
/*webkit浏览器*/
user-select:
auto;
/*用户是否能够选中文本*/
}