Twitter Style Glow on Input Focus
Recently Twitter homepage went through a redesign and included a soft glow on their login boxes when highlighted. A colleague wanted to recreate the effect and asked me to provide the code. The twitter one is a lot more complex and has a few more functions but the code below is the basics behind the …
Recently Twitter homepage went through a redesign and included a soft glow on their login boxes when highlighted. A colleague wanted to recreate the effect and asked me to provide the code.
The twitter one is a lot more complex and has a few more functions but the code below is the basics behind the effect. On the :focus style, the appropriate web browser prefixed CSS is required, but you get the general idea!
[CSS]
input {
border-radius: 5px;
border: none;
outline: none; /* Get Rid of the Webkit Default Glow */
}
input:focus {
box-shadow: 0 0 10px rgba(255, 255, 255, 0.9); /* -webkit/-moz prefixes needed */
}
[/CSS]