更改textarea的占位符文本颜色 [英] change placeholder text color of textarea
本文介绍了更改textarea的占位符文本颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道这里有这篇文章,占位符文本。我已经尝试在我的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 =整体满意度问题
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>
I know there is this post on changing the placeholder text. I've tried implementing in on my textarea tags
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;
}
but it's not doing anything. What am I missing?
This is what one of my textarea
's looks like
<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
/>
解决方案
...perhaps try to set some quotes?
onchange="{(e) => this.props.handleUpdateQuestion(e, firstQuestion.Id)}"
otherwise should work just fine:
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>
这篇关于更改textarea的占位符文本颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文