修改input标签的placeholder的默认样式

新建一个html,里面写一个input标签,修改他的样式placeholder样式如下:

      input::-webkit-input-placeholder {
        color: rgba(145, 174, 255, 1);
      }
      input::-moz-placeholder {
        /* Mozilla Firefox 19+ */
        color: rgba(145, 174, 255, 1);
      }
      input::-moz-placeholder {
        /* Mozilla Firefox 4 to 18 */
        color: rgba(145, 174, 255, 1);
      }
      input::-ms-input-placeholder {
        /* Internet Explorer 10-11 */
        color: rgba(145, 174, 255, 1);
      }

注:在Ie9及以下的版本不支持这样修改,需写js兼容

Guess you like

Origin blog.csdn.net/fankse/article/details/108272778
Recommended