我知道关于更改占位符文本的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 {
color: #0bf;
}
<textarea placeholder="test"></textarea>
我不确定,但我认为现在不必使用前缀。
textarea::placeholder {
color: #fff;
}
textarea ::占位符{color:#fff;}
::-webkit-input-placeholder {
color: orange;
}
:-moz-placeholder { /* Upto Firefox 18, Deprecated in Firefox 19 */
color: orange;
}
::-moz-placeholder { /* Firefox 19+ */
color: orange;
}
:-ms-input-placeholder {
color: orange;
}