时间: 2020-10-31|50次围观|0 条评论

 .a { 
        text-decoration: none;
        color: #fff;
        -webkit-tap-highlight-color: rgba(255, 255, 255, 0);
        -webkit-user-select: none;
        -moz-user-focus: none;
        -moz-user-select: none;
    }

二、使用图片作为a标签的点击按钮时,当触发touchstart的时候,往往会有一个灰色的背景

a,a:hover,a:active,a:visited,a:link,a:focus{ 
    -webkit-tap-highlight-color:rgba(0,0,0,0);
    -webkit-tap-highlight-color: transparent;
    outline:none;
    background: none;
    text-decoration: none;
}

三、改变选中内容的背景颜色

::selection {  
    background: #FFF; 
    color: #333; 
} 
::-moz-selection {  
    background: #FFF; 
    color: #333; 
} 
::-webkit-selection {  
    background: #FFF; 
    color: #333; 
} 

四、去除ios input框点击时的灰色背景

-webkit-tap-highlight-color:rgba(0,0,0,0);

原文链接:https://blog.csdn.net/weixin_42164539/article/details/106134462

本站声明:网站内容来源于网络,如有侵权,请联系我们,我们将及时处理。

本博客所有文章如无特别注明均为原创。
复制或转载请以超链接形式注明转自起风了,原文地址《CSS去除a标签在移动端点击时的背景颜色
   

还没有人抢沙发呢~