CSS uses only the data in the DOM tree, which has little to do with how the rendering decides what to do with elements with missing attributes.
So let CSS reflect HTML
input:not([type]), input[type="text"] { background:red; }
or make HTML explicit.
<input name='t1' type='text'/> /* Is Not Red */
If it is not, you can never tell
element { ...properties... }
and
element[attr] { ...properties... }
because all attributes will always be defined for all elements. (For example, table always has a border attribute, and 0 is the default attribute.)
Mr Lister Mar 07 '12 at 15:08 2012-03-07 15:08
source share