Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing a focus color in Chrome

I have a colour that appears on my input and textarea fields when they are focused:

enter image description here

This seems to happen in Chrome, but not Firefox.

I have tried to change the color with a bit of 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 appears to only make the current border bigger...but it does nothing to get rid of the blue colour.

like image 943
redconservatory Avatar asked Mar 14 '12 20:03

redconservatory


People also ask

How do I remove a select focus border?

Assigning outline a value of 0 or none will remove the browser's default focus style. If an element can be interacted with it must have a visible focus indicator.

How do you remove focus from an element?

The blur() method removes focus from an element.


1 Answers

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

like image 60
pimvdb Avatar answered Sep 24 '22 00:09

pimvdb