Say you have the following HTML:
<input />
<br />
<input type=text />
Of course, in my HTML I'll have other type of input fields as well (checkboxes, etc). Now I want to style the text inputs only.
What I find when searching, is to do the following in CSS:
input[type=text] { background: red; }
For the second input, where the attribute is explicitly present, this works. For the first however, it works in IE8, but not in IE10. Also not in Chrome.
So how can I target all text input fields, and only the text input field, while not having to put type=text
everywhere?
You can see this in a jsFiddle. For IE8, check out these instructions on how to get jsFiddle to work, but it looks like this: