Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get a glow in fields on focus?

Tags:

html

css

forms

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?

like image 464
lisovaccaro Avatar asked Feb 03 '23 23:02

lisovaccaro


1 Answers

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 :)

like image 165
Sarfraz Avatar answered Feb 05 '23 15:02

Sarfraz