html – 更改textarea的占位符文本颜色

我知道有关更改占位符文本的 this帖子.我已经尝试在我的textarea标签上实现
textarea::-webkit-input-placeholder {
color: #fff;
}

textarea:-moz-placeholder { /* Firefox 18- */
color: #fff;  
}

textarea::-moz-placeholder {  /* Firefox 19+ */
color: #fff;  
}

textarea:-ms-input-placeholder {
color: #fff;  
}

但它没有做任何事情.我错过了什么?

这就是我的textarea之一

<textarea
  onChange={(e) => this.props.handleUpdateQuestion(e,firstQuestion.Id)}
  placeholder="Overall Satisfaction Question"
  name="SEO__Question__c"
  type="text"
  className="slds-input"
  value={firstQuestion.SEO__Question__c ? firstQuestion.SEO__Question__c : ''}
  style={inputStyle}
  autoFocus
/>

解决方法

…也许试着设置一些报价?
onchange="{(e) => this.props.handleUpdateQuestion(e,firstQuestion.Id)}"

否则应该工作得很好:

textarea::-webkit-input-placeholder {
color: #0bf;
}

textarea:-moz-placeholder { /* Firefox 18- */
color: #0bf;  
}

textarea::-moz-placeholder {  /* Firefox 19+ */
color: #0bf;  
}

textarea:-ms-input-placeholder {
color: #0bf;  
}
<textarea placeholder="test"></textarea>

相关文章

vue阻止冒泡事件 阻止点击事件的执行 &lt;div @click=&a...
尝试过使用网友说的API接口获取 找到的都是失效了 暂时就使用...
后台我拿的数据是这样的格式: [ {id:1 , parentId: 0, name:...
JAVA下载文件防重复点击,防止多次下载请求,Cookie方式快速简...
Mip是什么意思以及作用有哪些