apply css to placeholder code example

Example 1: placeholder css

::-webkit-input-placeholder {color: pink;} /* Chrome/Opera/Safari */
::-moz-placeholder { color: pink;} /* Firefox 19+ */
:-ms-input-placeholder { color: pink;} /* IE 10+ */
:-moz-placeholder {color: pink;}  /* Firefox 18- */

Example 2: css style placeholder

<!DOCTYPE html>
<html lang="en">
   <head>
      <title>Placeholder - Style</title>
      <style>
         ::placeholder {
            color: green;
         }

         .force-opaque::placeholder {
            opacity: 1;
         }
      </style>
   </head>
   <body>
      <input placeholder="Default opacity..." />
      <input placeholder="Full opacity..." class="force-opaque" />
   </body>
</html>

Tags:

Css Example