输入占位符css在IE9中不起作用

时间:2016-01-19 12:23:21

标签: html css angularjs

占位符颜色仅在IE 9中不起作用。其他浏览器工作正常。 谁能告诉我IE9需要哪个css?我用了一个div - >选择元素 - >默认输入字段。想要更改占位符的文本颜色。我在Google上搜索它将在IE 10+上运行



input:-ms-input-placeholder    {
  color:#27AE60 !important;
}

<input type="text" ng-model="inputText" placeholder="somePlaceholder" />
&#13;
&#13;
&#13;

原始CSS选择器:

 #dropdown_ID div.selectize-control div.selectize-input input:-ms-input-placeholder {
      color:#27AE60 !important;
  }

1 个答案:

答案 0 :(得分:1)

是的,你是对的。 IE不支持占位符属性。 我发现这两个链接对于在IE中选择占位符的替代方法很有用。

推荐链接:

https://mathiasbynens.github.io/jquery-placeholder/
http://www.hagenburger.net/BLOG/HTML5-Input-Placeholder-Fix-With-jQuery.html

您可以使用任何方式解决问题。