Modify the default color of the input box placeholder text – webkit-input-placeholder method

Time:2019-8-18

HTML 5 adds a native placeholder attribute to input, which is supported by advanced browsers, such as:

<input type=”text” placeholder=”search” value=”>

The default placeholder font color is light gray. If you want to change the default color, the solution is as follows:

XML/HTML CodeCopy content to clipboard
  1. input:-moz-placeholder,   
  2. textarea:-moz-placeholder {   
  3.     color: #999999;   
  4. }   
  5.   
  6. input:-ms-input-placeholder,   
  7. textarea:-ms-input-placeholder {   
  8.     color: #999999;   
  9. }   
  10.   
  11. input::-webkit-input-placeholder,   
  12. textarea::-webkit-input-placeholder {   
  13.     color: #999999;   
  14. }  

The above modification input box placeholder text default color – WebKit – input – placeholder method is the editor to share all the content, I hope to give you a reference, but also hope that you support more developpaer.

Original address: http://www.cnblogs.com/xjuan/p/5436037.html