-1

There are other things on SO regarding this, but none of the solutions seem to work.

I'm trying to get rid of the light blue border that Google Chrome puts around any input box. My code:

#alphatxt:focus {
    border: 0;
    outline:none;
}

It works on buttons but doesn't on any input field It still doesn't remove the border, I've tried multiple different techniques that have been recommended but still no joy.

Can this be done?

Thanks

Arun Kumar M
  • 1,633
  • 1
  • 15
  • 26
scottdavidwalker
  • 1,118
  • 1
  • 12
  • 30

4 Answers4

1

You can try this it will work

#alphatxt:focus {
 outline: none; // removes blue outline on focus
 border: 0;  // removes border
 box-shadow: none; // removes shadow (for bootstrap etc )
}
nmanikiran
  • 2,866
  • 15
  • 19
0

Try doing

input:focus,
#alphatxt:focus {
    outline: 0;
}

However I wouldn't recommend removing it as the outline is used for people who don't have a mouse so they can use 'tab' and also the visually impaired. http://www.outlinenone.com/

James Nixon
  • 317
  • 4
  • 13
0

You need to override the outline property, a browser default:

https://jsfiddle.net/hv8s8ygn/

input:focus {
  outline: none;
}
David Wilkinson
  • 5,060
  • 1
  • 18
  • 32
0

Put below css in you css file

input[type="text"]:focus, textarea:focus 
{
  border: none !important;
  outline: 0 none;
}
Dhaval Patel
  • 1,076
  • 6
  • 19
  • I don't know about the "outline" definition (sometimes it works for me and sometimes it doesn't), but as for the "border" definition - that's a very bad idea to do that for ALL the text (and textarea) fields, because regardless to Chrome, focusing on these fields will hide their border alltogether, even if it's a regular border that we wish to have in these fields... – TheCuBeMan Jul 05 '16 at 14:44