39

When using Chrome or Safari, an active text box or text area will display a blue/orange border around the box. I have seen some sites get rid of this, but I have copied their CSS and it's still there. How do I do it?

Pbk1303
  • 3,702
  • 2
  • 32
  • 47
Chris
  • 579
  • 1
  • 6
  • 14
  • Further to this question, I wonder if it's possible to change the color of the outline instead of just removing it? I am in the same position, when the outline occurs, I get an ugly green color. Would be great to change it! – Kyle Sep 23 '10 at 15:07

3 Answers3

79

The following CSS usually removes the default highlight-border:

input:focus {outline: none; }

It's worth remembering that the outline is a useful visual feedback for the UI focus, for those users not using a mouse (keyboard navigation, for example), and it's worth substituting another visual cue to replace the loss of the outline.

David Thomas
  • 249,100
  • 51
  • 377
  • 410
16

You can use

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

But try to give some indication to the user that the form element is focused, for accessibility reasons.

Yi Jiang
  • 49,435
  • 16
  • 136
  • 136
3

I just did this :

:focus { outline: none; } 
ericmackey
  • 43
  • 3