Add shadow to input box on focus - HTML CSS CSS Property

HTML CSS examples for CSS Property:box-shadow

Description

Add shadow to input box on focus

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <title>Lorem ipsum dolor sit amet</title> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.bootstrap {<!--   w w  w . j a v  a 2  s .  com-->
   width:251px;
   border-radius:6px;
   background:Chartreuse;
   border:2px solid yellow;
   outline:none;
   padding:7px;
}

.bootstrap:focus {
   border:2px solid blue;
   box-shadow:0px 0px 4px 2px pink;
}
</style> 
 </head> 
 <body> 
  <input type="text" name="text" class="bootstrap">  
 </body>
</html>

Related Tutorials