HTML5 placeholders always appear slightly higher than the center of the input, so I'm trying to use CSS like ::-webkit-input-placeholder
to push them down a bit. For some reason, I can't combine the selectors. Here's a Fiddle demonstrating this: http://jsfiddle.net/n7VV7/
I don't want to separate them because I use a CSS compression tool that automatically combines lines. Right now, I can manually separate them, but in the future, I will forget that I can't combine these lines.
A comma-separated list of selectors represents the union of all elements selected by each of the individual selectors in the list. (A comma is U+002C.) For example, in CSS when several selectors share the same declarations, they may be grouped into a comma-separated list.
The comma in a CSS selector separates multiple selectors within the same styles. For example, let's look at some CSS below. th { color: red; } td { color: red; }
You can't use commas to combine vendor-prefixed selectors because when a browser encounters a selector it does not understand, that line is "thrown out." This is why it's necessary to break up vendor prefixes for any selector, not just the ::
pseudo-classes.
Here's a link to a CSS-Tricks comment on the problem.
It seems that it is impossible to combine them in one selector, because input-placeholder
selectors are used only separately and it is described in a standard.
There is a similar question around: Why isn't it possible to combine vendor-specific pseudo-elements/classes into one rule set?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With