Remove input box background image when input is active/focus - HTML CSS CSS Widget

HTML CSS examples for CSS Widget:Image

Description

Remove input box background image when input is active/focus

Demo Code

ResultView the demo in separate window

<html>
 <head> 
  <meta name="viewport" content="width=device-width, initial-scale=1"> 
  <style id="compiled-css" type="text/css">
.input-search {<!--   ww  w.ja  va  2  s .co m-->
   background:url('https://www.java2s.com/style/demo/Google-Chrome.png') no-repeat left 11px center;
}

.input-search:focus {
   background-image:none;
}
</style> 
 </head> 
 <body> 
  <input type="text" class="input-search">  
 </body>
</html>

Related Tutorials