请问如何用css去掉a标签点击时的背景色!

如题所述

方法如下:

    取消a标签在移动端点击时的蓝色:

    -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);

温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-09-23
a:hover{background:none;}

你定义错了吧

追问

我试了你的代码,不能用!

这是我的代码:是不是我哪里写的有问题

追答.foot-bard td a:hover{background:none;}

再试试,你的你这里加背景了已经,

追问

.foot-bard a:hover{ -webkit-tap-highlight-color: transparent;}

搞定了!!!

追答

....,采纳一下,你用的是什么浏览器,怎么会有这个问题!!

追问

我做的是手机端

追答

oo .采纳一下要不

本回答被网友采纳
第2个回答  推荐于2018-02-26

移动端的a链接这样设置一下

a:hover{

    -webkit-tap-highlight-color: transparent;

}

本回答被网友采纳
第3个回答  2016-09-23
a{ text-decoration:none; }
相似回答