Removing the blue glow from an HTML text input whe

2019-03-08 06:33发布

How can I remove the blue glow that surrounds a selected text input box using pure CSS?

标签: css input
2条回答
放我归山
2楼-- · 2019-03-08 07:23

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.

查看更多
对你真心纯属浪费
3楼-- · 2019-03-08 07:29

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.

查看更多
登录 后发表回答