当选择时,从 HTML 文本输入中移除蓝色发光

如何使用纯 CSS 移除所选文本输入框周围的蓝色发光?

100640 次浏览

This should do it:

input:focus {
outline:none;
}

EDIT (2015): If you are designing for a wide audience, recall that the outline is often a critical accessibility feature for users who navigate via keyboards or require more apparent visual feedback. If you remove the outline, make sure to define an alternative focus state that provides appropriate visual feedback to your users.

I prefer a nice solid reset like:

input, textarea, select, a { outline: none; }

Outline 'none' on anchor tags prevents horrible focus outlines on many Android browsers.

if you are using bootstrap then you have to add box-shadow: none

input:focus {
outline:none;
box-shadow: none;
}