桌面:当您将鼠标悬停在按钮或锚点链接中时,背景颜色会发生变化。移动:悬停或活动不会更改背景颜色。
.btn { background: transparent; color: #000; } .btn:hover, .btn:active { background: #bf0; color: #fff; }
这段代码解决了我的问题
document.addEventListener("touchstart", function(){}, true)