How to Disable CSS for a particular field

Viewed 56

I am using a styling for all the input fields but there is one field for which i do not want that style. Is there any way i can disable the css for that particular field and let it be for others.

3 Answers

You can add a css class to that element and use :not pseudo-class selector:

input:not(.notred) {
  background: red;
}
<input name="text1">
<input name="text2">
<input name="text3">
<input class="notred" name="text4">
<input name="text5">
<input name="text6">

In CSS3, you can use ‘:not()’ to exclude an element using id or class.

add a class to that input which you want to disable, then in css

input:not(.that_class)

Let me know if you have any issue.

Related