Kalen
Kalen

Reputation: 3126

Getting rid of the blue focus rectangle on input boxes in HTML/CSS?

I'm running Mac OS so I can't really tell if this effect is presented on windows machines or not, so I apologize if this effect is not seen for you.

Input and TextFields seem to have a blue rectangle when focused, atleast on Firefox and Chrome on a Mac. I have a custom focus effect on a site, and I'm wondering if I can avoid having this default selection behavior show. Google avoids it on their site. I went as far as to get the 'in-effect' CSS style for Google's input box, apply that to my css object. However, it still shows the blue rectangle. I'm not exactly sure what kind of voodoo google is doing, but it seems to me that it's neither HTML or CSS attributes. Anyone know how to avoid this effect? Thanks!

Upvotes: 59

Views: 62463

Answers (1)

BoltClock
BoltClock

Reputation: 723388

It is in fact a CSS attribute. This will hide that glowing effect:

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

Upvotes: 141

Related Questions