如何为angucomplete-alt的占位符添加颜色

时间:2015-07-03 13:34:49

标签: angularjs

我有一个angucomplete-alt输入字段,当有人专注于它时,我想要的功能是将占位符的颜色更改为蓝色。

<div tpcomplete-alt='true' input-class='isused form-control' match-class='autocomplete-highlight' name='name' minlength='3' placeholder='Skill Name, E.g. Java' selected-object="onSelectSkill" title-field="text" remote-url='/api/skills?q=' override-suggestions="true" style='width:150px;'></div>

将一个类添加到&#39;输入类&#39;只更改我输入的文本的颜色,但我想更改占位符的颜色。任何人都可以告诉我正确的方法来做到这一点.. 感谢

1 个答案:

答案 0 :(得分:0)

你应该指定你的div的id,然后尝试添加这样的类:

HTML:

<div id='ex1' tpcomplete-alt='true' input-class='isused form-control' match-class='autocomplete-highlight' name='name' minlength='3' placeholder='Skill Name, E.g. Java' selected-object="onSelectSkill" title-field="text" remote-url='/api/skills?q=' override-suggestions="true" style='width:150px;'></div>

CSS:

#ex1_value:placeholder-shown {
    color: #000;
}

#ex1_value::-webkit-input-placeholder {
    color: #000;
}
#ex1_value:-moz-placeholder {
    color: #000;

}
#ex1_value::-moz-placeholder {
    color: #000;

}
#ex1_value:-ms-input-placeholder {
    color: #000;

}

注意:当你将id作为ex1时 它将为占位符创建子ID作为ex1_value