HTML5 does not require the type attribute on input elements when the type is text.

Is it possible to select only text inputs when the type attribute is not specified?


input[!type], input[type=text]{
    /* styles for <input /> and <input type=text /> only */

1 answer

This was chosen as the best answer

The :not selector would allow this:

input:not([type]), input[type="text"] {

The W3C has a great resource on CSS selectors (the document is for CSS3 though those should both work in CSS2).

Answered over 8 years ago by Tom Smilack
  • Perfect. Exactly what I was looking for. David Murdoch over 8 years ago