Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text field "glowing" effect like Twitter and Tumblr login pages?

What's the best way to achieve a glowing effect when focusing on a text field in HTML? Can it be done with CSS alone, or does it involve images? Check out the login pages for Twitter and Tumblr for working examples.

enter image description here

like image 339
raffian Avatar asked Feb 26 '12 17:02

raffian


1 Answers

Just use the :focus pseudo-class, border and box-shadow:

.text:focus {
    border: 1px solid #07c;
    box-shadow: 0 0 10px #07c;
}

Here's a demo.

Oh, and here's my favorite combination.

like image 82
Ry- Avatar answered Nov 15 '22 03:11

Ry-



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!