active在苹果手机上失效的解决办法:
在iOS系统的移动设备中,需要在按钮元素或body/html上绑定一个touchstart事件才能激活:active状态。
要让css的:active伪类生效,只需要给这个元素的touchstart/touchend绑定一个空的匿名方法即可成功。
Use the :active pseudo-class in your css, then add ontouch
start="" and onmouseover="" to the body tag.(在您的css中使用:active伪类,然后添加ontouchstart=“”和onmouseover=“”到body标签。)
//非常简单
解决active在苹果手机上失效的问题
最新推荐文章于 2024-03-22 20:09:53 发布