Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is CSS text color overriding placeholder color in IE 10?

Why is the color setting for -ms-input-placeholder is being overriden by the color setting for input fields? (input[type=text],input[type=password], textarea, select)

In Chrome and Firefox this works fine.

See image with blue placeholder text, even though -ms-input-placeholder is set to red.

IE 10 Dev Tools

like image 412
Joshua Fox Avatar asked Feb 12 '23 16:02

Joshua Fox


1 Answers

Chances are your input[type=text] selector appears after your input:-ms-input-placeholder selector in your stylesheet, which is causing it to take precedence (because both selectors are equally specific). If that's the case, you'll want to move the placeholder rule below in order for that to take precedence.

The most likely reason it works in Chrome and Firefox is because they both use a pseudo-element, not a pseudo-class, to target the placeholder text, which is something different altogether.

like image 102
BoltClock Avatar answered Feb 16 '23 02:02

BoltClock