Transition placeholder opacity - HTML CSS CSS Property

HTML CSS examples for CSS Property:opacity

Description

Transition placeholder opacity

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[type=text]:-moz-placeholder {
   opacity:2;
   transition:opacity 2s;
}

input[type=text]:focus:-moz-placeholder {
   opacity:.2;
}

input[type=text]::-webkit-input-placeholder {
   opacity:2;
   transition:opacity 2s;
}

input[type=text]:focus::-webkit-input-placeholder {
   opacity:.2;
}
</style> <!--from  www  . ja  v  a 2  s .c o  m-->
 </head> 
 <body> 
  <input type="text" placeholder="some cool text">  
 </body>
</html>

Related Tutorials