加上如下样式:
<style> input::-webkit-input-placeholder { /* WebKit, Blink, Edge */ color: #3A9CFD !important; } input::-moz-placeholder { /* Mozilla Firefox 4 to 18 */ color: #3A9CFD !important; } input:-moz-placeholder { /* Mozilla Firefox 19+ */ color: #3A9CFD !important; } input:-ms-input-placeholder { /* Internet Explorer 10-11 */ color: #3A9CFD !important; } </style>
在网上搜的时候,找到的大部分都是没有加 !important的,我也不知道为什么,总是没有效果。当我加上 !important之后,就有效果了,希望对走过的人能有所帮助吧。