Reputation: 34
Hello I would like to ask a question regarding css style.
I put the same color value in the placeholder text and also in a select dropdown. But the color that the browser shows differs.
Anyone can explain why this happens?
Here is an example: http://scratchpad.io/abounding-coat-5186
edit: What I want to achieve is exactly the same text-color. I dont want that opacity effect that the placeholder has.
Upvotes: 0
Views: 1395
Reputation: 3627
You can rewrite placeholder styles with this pseudo-classes/pseudo-elements
input::-webkit-input-placeholder { /* Chrome/Opera/Safari/ */
color: red;
opacity: 1;
}
input:-moz-placeholder { /* Firefox 18- */
color: red;
opacity: 1;
}
input::-moz-placeholder { /* Firefox 19+ */
color: red;
opacity: 1;
}
input:-ms-input-placeholder { /* IE */
color: red;
opacity: 1;
}
JSfiddle here
Upvotes: 3
Reputation: 6837
I think you want to change placeholder. here how to change placeholder color
::-webkit-input-placeholder {
color: red;
}
Upvotes: 0