Is there a CSS3 selector like jQuery's :input which returns all input fields: select, input, textarea and button?
Even a browser-specific implementation would be fine, as long as it's CSS-only.
Is there a CSS3 selector like jQuery's :input which returns all input fields: select, input, textarea and button?
Even a browser-specific implementation would be fine, as long as it's CSS-only.
Not directly, no. However you can work around this with the :enabled and :disabled selectors:
:enabled, :disabled {
...
}
:enabled property seems to be perfect for my situation. To clarify, the enabled property only applies to <button>, <input>, <optgroup>, <option>, <select>, and <textarea> - which is perfectYou can try to use:
textarea, input[type] {
/* Your styles here */
}
Above selector will applied to all textareas and any input that has a type attribute.
text — specifying that the input must have an explicit type attribute isn't really helpful in the context of the OP.