加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 资源网站 > 资源 > 正文

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

发布时间:2020-12-14 21:13:24 所属栏目:资源 来源:网络整理
导读:我知道有关更改占位符文本的 this帖子.我已经尝试在我的textarea标签上实现 textarea::-webkit-input-placeholder {color: #fff;}textarea:-moz-placeholder { /* Firefox 18- */color: #fff; }textarea::-moz-placeholder { /* Firefox 19+ */color: #fff;
我知道有关更改占位符文本的 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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读