文本区占位符不接受属性



我的问题是textarea占位符不接受css属性

我有HTML:
<textarea id="information" class="career-form-textbox" name="message" placeholder="Add a cover letter or anything else you want to
share.">
</textarea>

CSS:

input,
textarea::-webkit-input-placeholder {
  color: #848484;
  font-size: 18px;
  font-weight: 400;
  opacity: 0.2;
  font-family: Open Sans;
}
input,
textarea:-moz-placeholder,
color #848484 {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.2;
  font-family: Open Sans;
}
input,
textarea::-moz-placeholder,
color #848484 {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.2;
  font-family: Open Sans;
}
input,
textarea:-ms-input-placeholder,
color #848484 {
  font-size: 18px;
  font-weight: 400;
  opacity: 0.2;
  font-family: Open Sans;
}

,但它不能工作,提前感谢,抱歉糟糕的格式浏览器:Chrome

似乎你有一些语义错误在你发布的css代码。试试这个:

input,
textarea::-webkit-input-placeholder { /* WebKit browsers */
    color: #848484;
}
input,
textarea:-moz-placeholder { /* Mozilla Firefox 4 to 18 */
   color: #848484;
   opacity:  1;
}
input,
textarea::-moz-placeholder { /* Mozilla Firefox 19+ */
   color: #848484;
   opacity:  1;
}
input,
textarea:-ms-input-placeholder { /* Internet Explorer 10+ */
   color: #848484;
}
<textarea id="information" class="career-form-textbox" name="message"
placeholder="Add a cover letter or anything else you want to
share."></textarea>

相关内容

  • 没有找到相关文章

最新更新