Is there a difference in CSS selectors `: enabled` vs` not (: disabled)`

Is there any difference in behavior or browser support for using CSS3 selectors :enabledor not(:disabled)?

I expect them to be functionally identical, and since they are both CSS3 selectors, browser support should also be the same.

+4
source share
1 answer

Yes, there is a difference - it :not(:disabled)can correspond to elements that are not :enabledand :disabled. These are elements in which the enabling / disabling semantics simply not applicable, e.g. div, p, uletc.

spec confirms this:

, , . :enabled, :disabled.

, :checked - :unchecked, , / . . .

(, input, select textarea) , , , . , :enabled, :not(:disabled).

3 - , :enabled :disabled. , MDN, Opera 9.0 Safari 3.1 :not(), :enabled :disabled , - sibling ~ IE7 IE8.

+7

Source: https://habr.com/ru/post/1609595/


All Articles