Removing focus color in Chrome

I have a color that appears in my input and textarea fields when they are focused:

enter image description here

This is similar to Chrome, but not Firefox.

I tried changing the color using jQuery:

if ($('body').is('#contact')) { $('input').focus(function() { $(this).css('border', '2px solid #ce1443'); console.log('focus'); }); $('textarea').focus(function() { $('textarea').css('border', '2px solid #ce1443'); }); } 

However, this, apparently, only makes the current border bigger ... but it does nothing to get rid of the blue color.

+4
source share
3 answers

Use the outline: none CSS property: http://jsfiddle.net/ZnefN/ .

+7
source

try css:

 input:focus { outline: none; } 

and get all input and text areas and select fields

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

In addition, I think this may be superfluous for this question.

+5
source

This is something you can fix with CSS:

 input:focus { outline: 0 none; } 
+1
source

Source: https://habr.com/ru/post/1401469/


All Articles