2015-07-03 58 views
0

我有一個angucomplete-ALT輸入字段,而我期望的功能是改變佔位符爲藍色,當有人專注於IT的顏色..如何將顏色添加到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>

向'input-class'添加一個類只會改變我輸入的文本的顏色,但是我想改變佔位符的顏色。誰能告訴我做正確的方式.. 感謝

回答

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