lisovaccaro
lisovaccaro

Reputation: 34016

How do I get a glow in fields on focus?

I noticed some browsers make some fields glow when you select a form, Chrome makes them have a yellow glow for example. How do you make a field glow? I believe it's something you specify loosely on the code since different browsers do different colors. How does that work? Is there a simple way I could do it?

Upvotes: 9

Views: 8569

Answers (1)

Sarfraz
Sarfraz

Reputation: 382909

Check out the demo


CSS Used:

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;
}

You can also check out this page i had created similar effect

Note:

The box-shadow is CSS3 property meaning it won't work in IE<8, however you can use something like CSS3PIE to get the support even in IE :)

Upvotes: 12

Related Questions