怎样用CSS改变placeholder字体颜色

admin 提交于 周四, 02/12/2015 - 14:27

<style>
::-webkit-input-placeholder { /* WebKit browsers */
    color:    #909;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
   color:    #909;
   opacity:  1;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
   color:    #909;
   opacity:  1;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
   color:    #909;
}
</style>

<input placeholder="Stack Snippets are awesome!">

标签