2012-08-13 127 views
0

我不能把兩個不同的規則,在「沒有」選擇 例子:CSS「而不是」選擇不工作

此代碼:

input:not([type=submit]) { 
    // Styling here 
} 

但是這個代碼不工作:

input:not([type=submit], [type=reset]) { 
    // Styling here 
} 

爲什麼第二個代碼不起作用?

回答

6

您的CSS語法無效。

使用2 :not選擇:

input:not([type=submit]):not([type=reset]) { 
    // Styling here 
} 
+0

OK,但是這成爲當有大量的代碼麻煩。例如:'input:focus:invalid:not([type = submit]),input:focus:invalid:not([type = reset]),...' – 2012-08-13 10:22:37

+0

@JérémyDupont不,你只需要輸入:重點:無效:沒有([類型=提交]):不使用(類型=復位])' – Curt 2012-08-13 10:24:06