Select all forms except one without special action using css

I need to write a css rule for all forms except a form with a specific action,

I currently have the following css, for all #NavMenu I hide them, but for the search I want to show them.

form #NavMenu{
display:none;
}
form[action*='Search'] #NavMenu{
display:block;
}

Is there a way to specify all forms, but not this, for example

form:not(form[action*='search']) #NavMenu{
display:none;
}
+4
source share
1 answer

The selector should be as below

form:not([action*='search'])where the form will search if it has an attribute

+4
source

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


All Articles