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 />
In most browsers, the placeholder text is grey. To change this, style the placeholder with the non-standard ::placeholder selector. Note that Firefox adds a lower opacity to the placeholder, so we use opacity: 1 to fix this.
Note: In most browsers, the appearance of placeholder text is a translucent or light gray color by default.
Use the ::placeholder pseudo-element to style your placeholder text in an <input> or <textarea> form element. Most modern browsers support this, but for older browsers, vendor prefixes will be required.
Wrap in quotes:
onchange="{(e) => this.props.handleUpdateQuestion(e, firstQuestion.Id)}"
otherwise, it 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 { color: #0bf; }
<textarea placeholder="test"></textarea>
I am not sure but I think is not necessary to use the prefixes right now.
textarea::placeholder { color: #fff; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With