How to remove the stroke when clicking on input

When you click and focus on input, an outline appears. How do I remove it?

Author: Vadizar, 2011-04-20

9 answers

input {outline:none;}

This technique also removes the dotted line around the clicked link and around any of the form elements.

 31
Author: Ведрусс, 2020-06-08 13:42:00

A universal solution that removes highlighting in all browsers and not only on input, but also on other elements, including select, button, a:

/* Remove outline on the forms and links */
:active, :hover, :focus {
    outline: 0;
    outline-offset: 0;
}
 17
Author: Vadizar, 2020-05-13 11:06:34

Try putting box-shadow: none; I had this problem. I just did so when using Bootstrap

 2
Author: BRILICK, 2020-06-05 19:21:05

I had this problem. I just did this:

input {outline: 0 !important;}
 1
Author: razboynik, 2015-04-05 01:14:21

Apply the property outline:none

 1
Author: Dimcheg, 2020-06-05 19:20:56

Specifically for input and specifically when focusing on it:

input:focus {outline: 0;}

I checked it on Chrome.

 0
Author: Vladimir Pankov, 2020-06-08 13:42:15

If you use Bootstrap, then box-shadow may be used.

Try putting box-shadow: none;

 0
Author: borkafight, 2020-06-08 13:42:37

Add also onFocus="this.blur()"

 0
Author: ling, 2020-06-08 13:42:47

There is no way to physically remove the stroke, the browser draws it itself. In fact, it can be collapsed to a point if the A element has a style of display:inline instead of display:block. This won't affect the hotspot, but it's a bad option.

It is best to make the A element on top of the entire label, then nothing will obscure the label and it will look great.

 -2
Author: Alex Silaev, 2020-06-05 19:21:30