使用CSS+React+语义UI更改占位符颜色

使用CSS+React+语义UI更改占位符颜色,css,reactjs,semantic-ui,placeholder,Css,Reactjs,Semantic Ui,Placeholder,我可以用CSS更改表单的占位符文本,这样所有字段都将是相同的蓝色,除了弹出日历的生日字段,它保持浅灰色。我试图选择这个特定的占位符,但没有成功。有没有办法纠正这个问题?这是我的代码 ::placeholder { color: #8DA0B3; opacity: 1; } input[type="birthday"].date::-webkit-input-placeholder { color: #8DA0B3; } 不完全确定type=birthday是否是一个类型

我可以用CSS更改表单的占位符文本,这样所有字段都将是相同的蓝色,除了弹出日历的生日字段,它保持浅灰色。我试图选择这个特定的占位符,但没有成功。有没有办法纠正这个问题?这是我的代码

::placeholder {
    color: #8DA0B3;
    opacity: 1; 
}

input[type="birthday"].date::-webkit-input-placeholder {
  color: #8DA0B3;
}
不完全确定type=birthday是否是一个类型,但据我所知,您无法从输入[type=date]更改占位符颜色

您可以尝试使用“hacks”等来更改占位符的颜色

好的参考是:

如果链接曾经中断:

<input type="date">
#document-fragment
<div dir="ltr" pseudo="-webkit-date-and-time-container">
  <div pseudo="-webkit-datetime-edit">
  <span aria-help="Day" aria-valuemax="31" aria-valuemin="1" pseudo="-webkit-datetime-edit-day-field" role="spinbutton">dd</span>
  <div pseudo="-webkit-datetime-edit-text">/</div>
  <span aria-help="Month" aria-valuemax="12" aria-valuemin="1" pseudo="-webkit-datetime-edit-month-field" role="spinbutton">mm</span>
  <div pseudo="-webkit-datetime-edit-text">/</div>
  <span aria-help="Year" aria-valuemax="275760" aria-valuemin="1" pseudo="-webkit-datetime-edit-year-field" role="spinbutton">yyyy</span></div>
  <div></div>
  <div pseudo="-webkit-calendar-picker-indicator"></div>
</div>
<input type="date">
#document-fragment
<div dir="ltr" pseudo="-webkit-date-and-time-container">
  <div pseudo="-webkit-datetime-edit">
  <span aria-help="Day" aria-valuemax="31" aria-valuemin="1" pseudo="-webkit-datetime-edit-day-field" role="spinbutton">dd</span>
  <div pseudo="-webkit-datetime-edit-text">/</div>
  <span aria-help="Month" aria-valuemax="12" aria-valuemin="1" pseudo="-webkit-datetime-edit-month-field" role="spinbutton">mm</span>
  <div pseudo="-webkit-datetime-edit-text">/</div>
  <span aria-help="Year" aria-valuemax="275760" aria-valuemin="1" pseudo="-webkit-datetime-edit-year-field" role="spinbutton">yyyy</span></div>
  <div></div>
  <div pseudo="-webkit-calendar-picker-indicator"></div>
</div>
::-webkit-datetime-edit-year-field {
   font-weight: bold;
 }