我正在处理一个CSS文件,并发现需要设置文本输入框的样式,但是,我遇到了问题。我需要所有这些元素相匹配的简单声明:css选择器以匹配没有属性的元素x
<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规范中没有我能找到的选择器。
有谁知道一种方法来完成这个?
这是不支持IE6,IE7和可能不是在IE8 – 2009-10-07 19:08:52
@Tim,话又说回来了,_is_支持哪些:使用selectivizr在过时的歌曲没有选择器在IE6,7和8 ... – priestc 2009-10-07 19:36:43
@ nbv4,真正的dat,但看到我的答案。 – 2009-10-07 19:49:55