我工作的一个CSS文件,并找到需要风格的文本输入框,但是,我遇到了问题。 我需要所有这些元素相匹配的简单声明:
<input />
<input type='text' />
<input type='password' />
...但不匹配这些的:
<input type='submit' />
<input type='button' />
<input type='image' />
<input type='file' />
<input type='checkbox' />
<input type='radio' />
<input type='reset' />
这是我想做些什么:
input[!type], input[type='text'], input[type='password'] {
/* styles here */
}
另外,在上述CSS,注意第一选择器input[!type]
。 我的意思是我想选择其中类型属性未指定(因为它默认为文本,但所有的输入框中input[type='text']
不匹配的话)。 不幸的是,在CSS3规范,我能找到没有这样的选择。
有谁知道的一种方式做到这一点?