<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>a标签点击有蓝色背景</title>
<style>
a{
position: absolute;
width: 100px;
height: 100px;
background-color: antiquewhite;
}
</style>
</head>
<body>
<a href="https://www.baidu.com/"></a>
</body>
</html>
这个是正常情况下代码的样子
下面是视图
点击前的样子
点击时的样子
可以自己写写,就会发现明显的蓝色背景
添加
在css里加入:
-webkit-tap-highlight-color:rgba(0,0,0,0);
或
-webkit-tap-highlight-color: transparent;
写在单独的标签里面可以,但一个页面不可能只用一个a标签,我就写在了body里,全局可以用
怎么点背景都不变,ok问题解决