当您单击锚点时,如何避免 IE 10 对锚点应用的恼人的灰色背景?
			
			7462 次
		
4 回答
            27        
        
		
实际上有一个非常简单的 CSS 修复程序。IE 10 在background-color锚标记处于:active状态时会更改它们。要阻止它发生或更改颜色,您可以使用下面的 CSS 规则。
a:active{
    background-color: transparent; /* Can be any colour, not just transparent */
}
现场演示:http: //jsfiddle.net/tw16/NtjK7/
在旁注中,值得一提的是,在设置链接样式时,您需要确保以正确的顺序编写规则,以确保以前的样式不会被覆盖:
a:link{}    /* 1st */
a:visited{} /* 2nd */
a:hover{}   /* 3rd */
a:active{}  /* 4th */
于 2013-03-21T22:14:02.283   回答
    
    
            4        
        
		
我发现它实际上是 :focus 添加了灰色背景。
这对我有用:
a:focus {
    background-color: transparent;
}
于 2013-08-22T15:06:59.847   回答
    
    
            0        
        
		
经过许多徒劳的测试,我终于使它适用于这个:
  a               {color:#fff; background-color:#f77927 !important;}
  a:hover         {color:#fff; background-color:#e65e06 !important;}
  a.active        {color:#fff; background-color:#e65e06 !important;}
  a.focus         {color:#fff; background-color:#e65e06 !important;}
于 2014-09-09T09:47:32.430   回答