Css: not () selector does not support complex selectors inside

With CSS3 both the selector :not() and the attribute contains selector , but when mixing both, a problem arises, it does not work.

HTML:

 <input type='text'/> <input type='text' id="dasd_Date_asd"/> 

CSS

 input[type='text']:not(input[id*='Date']) { display:none; } 

Demo

Can anyone tell what is going on here?

Note. When changing the markup, we are not given any privileges.

+5
source share
2 answers

You cannot use two selectors in not:

 input[type='text']:not([id*='Date']) { display: none; } 
 <input type='text' /> <input type='text' id="dasd_Date_asd" /> 

A level 3 selector does not allow anything more than a simple selector in the class pseudo-class: not ().

+9
source

You must first select an input type, and then disable input with an identifier of the type that is set to Date. you again provided input as a selector in: not ()

try it.

  input[type='text']:not([id*=Date]) { display:none; } 
 <input type='text'/> <input type='text' id="dasd_Date_asd"/> 
+4
source

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


All Articles