码农之家

用css选择器选一个不包含某属性的元素

我们可以使用:not 选择器来实现。

代码如下:

input:not([type]), input[type='text'], input[type='password'] {
   /* style here */
}

not: 选择器只能使用在IE9或更高的版本之上。