I'm having a heck of a time with this particular CSS selector which does not want to work when I add :not(:empty)
to it. It seems to work fine with any combination of the other selectors:
input:not(:empty):not(:focus):invalid { border-color: #A22; box-shadow: none }
If I remove the :not(:empty)
part, it works just fine. Even if I change the selector to input:not(:empty)
it still won't select input fields which have text typed into them. Is this broken or am I just not allowed to use :empty
within a :not()
selector?
The only other thing I can think of is that browsers are still saying that the element is empty because it has no children, just a "value" per say. Does the :empty
selector not have separate functionality for an input element versus a regular element? This doesn't seem probable though because using :empty
on a field and typing something into it will cause the alternate effects to go away (because it is no longer empty).
Tested in Firefox 8 and Chrome.