移动端a标签点击背景变色

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

1
2
3
4
-webkit-tap-highlight- color : rgba( 255 255 255 0 );
-webkit-user-select:  none ;
-moz-user-focus:  none ;
-moz-user-select:  none ;

  

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

1
2
3
4
5
6
7
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 ;
}

  

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

1
2
3
4
5
6
7
8
9
10
11
12
::selection { 
     background #FFF
     color #333
::-moz-selection { 
     background #FFF
     color #333
::-webkit-selection { 
     background #FFF
     color #333

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

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

猜你喜欢

转载自blog.csdn.net/aydongzhiping/article/details/78319344