首页 > 移动平台 > 详细

移动端 -webkit-user-select:text; ios10 bug 解决方案

时间:2017-02-23 13:56:05      阅读:1036      评论:0      收藏:0      [点我收藏+]

移动端一般body的css、会设置 作用就不解释了;

body{ height:100%;min-height:100%; font-family: "微软雅黑",‘Helvetica Neue‘,Helvetica,tahoma,arial,sans-serif; text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased; line-height: 1; font-size:14px;-webkit-touch-callout:none;-webkit-user-select:none;}

 

我们看看下面的代码

<div  style=" margin-top: 100px; background: #888;">
	<p  style="-webkit-user-select:text !important;line-height: 30px; padding: 10px;  text-align: center; ">1移动端 suface复制文本测试啊  父类没有 -webkit-user-select:text;;</p>

</div>

  

 

以上代码 手机iphone5s 的ios9 没问题,可是换个iphone7 ios10的 出现 无法选中

后来去掉所有css 样式  js 发现

解决方案

1 去掉body的 -webkit-touch-callout:none;但是不切实际 

2 其他能选文本复制的地方 (下面的)  的文本先手动选择一下。然后再去选择你要选的就可以了;不实际;

3后来发现必须 父元素加个-webkit-user-select:text;才有效,单独子元素即使加-webkit-user-select:text!important也无效

<div  style=" margin-top: 200px; background: #888;-webkit-user-select:text;;">
	<p  style="-webkit-user-select:text !important;line-height: 30px; padding: 10px;  text-align: center; "> 2移动端 suface  复制文本测试啊 父类 加了-webkit-user-select:text;;</p>
</div>

  

 

工作中的小问题,记录一下;




移动端 -webkit-user-select:text; ios10 bug 解决方案

原文:http://www.cnblogs.com/surfaces/p/6432712.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!