CSS3解决移动页面上点击链接触发色块的问题

2020-05-14 07:49:35易采站长站整理

    display: block;   
    text-align: center;   
}   
a:link,a:visited,a:hover,a:active{   
    color:#fff;       
    text-decoration: none;   
}   
.no{   
    -webkit-tap-highlight-color:rgba(0,0,0,0);   
}   
.hasRed{   
    -webkit-tap-highlight-color:rgba(255,0,0,1);   
}   
  
</style>   

</head>   

<body>   
    <p>默认<br><a href="javascript:void(0)">a标签</a></p>   
    <p>无色块<br><a href="javascript:void(0)" class="no">a标签</a></p>       
    <p>点击之后有红色块<br><a href="javascript:void(0)" class="hasRed">a标签</a></p>   
  
</body>   
</html>