今天需要修改placeholder的字體顏色(正常爲灰色),所以網上查詢了一下,很簡單就可以實現,在style中輸入下列即可:
這些是爲了不同瀏覽器做適配
::-webkit-input-placeholder { /* WebKit browsers */
color: white;
}
:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
color: white;
}
::-moz-placeholder { /* Mozilla Firefox 19+ */
color: white;
}
:-ms-input-placeholder { /* Internet Explorer 10+ */
color: white;
}