4

is it possible to simulate the outer glow that safari and other browsers add to an input field? And avoiding jquery if possible?

This article explains how to remove it: http://www.altrugon.com/css/remove-safaris-input-focus-outer-glowquitar-el-border-azul-de-los-inputs-en-safari/

Thanks

user441365
  • 3,934
  • 11
  • 43
  • 62

3 Answers3

22

Check out the DEMO

Here box-shadow is used in combination with :focus psudo selector.

CSS:

input:focus,textarea:focus,select:focus{
  border:1px solid #fafafa;
  -webkit-box-shadow:0 0 6px #007eff;
  -moz-box-shadow:0 0 5px #007eff;
  box-shadow:0 0 5px #007eff;
  outline: none;
}
Community
  • 1
  • 1
Sarfraz
  • 377,238
  • 77
  • 533
  • 578
0

If you wanted to simulate it exactly as it's displayed on webkit browsers you could use CSS3 Box shadow using the :focus pseudo class, although note that CSS3 is not supported on all browsers.

amosrivera
  • 26,114
  • 9
  • 67
  • 76
0

You can do it with css:

input:focus
{
    outline:#00FF00 solid thick;
}

This is the html:

<input />
<br/>
<br/>
<input />
Kees C. Bakker
  • 32,294
  • 27
  • 115
  • 203