之前看别人的代码,发现他的body标签添加ontouchstart属性。即

1 <body ontouchstart>

上网查了一下原因,记录一下:

这个操作是进行手机端兼容处理的,防止伪类:active失效。

相关文章: