I'm trying to style placeholder text in different browsers using vendor-prefixed selectors. When I use separate code blocks for each selector, it works fine. However, when I try to use a comma-separated list of selectors instead of repeating the CSS for each, it doesn't work. Can anyone shed some light on this issue?
This approach works:input[type=text]::-webkit-input-placeholder {
color: green;
}
input[type=text]::-moz-placeholder {
color: green;
}
input[type=text]:-ms-input-placeholder {
color: green;
}
input[type=text]:-moz-placeholder {
color: green;
}
<input type="text" placeholder="Placeholder Text" />
input[type=text]::-webkit-input-placeholder,
input[type=text]::-moz-placeholder,
input[type=text]:-ms-input-placeholder,
input[type=text]:-moz-placeholder {
color: green;
}
<input type="text" placeholder="Placeholder Text" />
Why is that?