Select multiple inputs

Posted on

Question :

I have the following question if you can improve this selection:

#form-login > input[type="email"], #form-login > input[type="password"] {}

Because if I have multiple inputs it will get very large ..

    

Answer :

You can use not, excluding the element you do not want to apply the same rule in your case would look like this:

   #form-login input:not([type="submit"]){ background-color:#000;}

The not selector is very useful for deleting elements from selectors when you do not need them. I think it’s the most appropriate in your case, instead of putting all you need, just take out what you do not want.
I hope I have helped !!

    

Leave a Reply

Your email address will not be published. Required fields are marked *