Chrome default focus outline

随声附和 提交于 2019-11-29 21:13:46

问题


I'm trying to remove default focus froom chrome and it works with outline:none; in the same time I want to add an box-shadow but it not working for select .

*:focus { outline:none; }

input[type="text"]:focus,input[type="checkbox"]:focus,input[type="password"]:focus,
select:focus, textarea:focus,option:focus{
box-shadow:0 0 2px 0 #0066FF;
-webkit-box-shadow:0 0 9px 0 #86AECC;
z-index:1;
}

fiddle: http://jsfiddle.net/DCjYA/309/


回答1:


Try this:

* { 
    outline-color: lime;
}



回答2:


for me this worked

 :focus {
       outline: -webkit-focus-ring-color auto 0;
 }



回答3:


This should also do the trick:

a:focus, a:active {
    outline-color: transparent !important;
}



回答4:


Most effective solution on Links only:

a:focus, a:active{
    outline:none;
}

Or you can disable global:

*{
    outline:none;
}


来源:https://stackoverflow.com/questions/9178718/chrome-default-focus-outline

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!