Aditya
Aditya

Reputation: 63

How to Disable CSS for a particular field

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.

Upvotes: 2

Views: 75

Answers (3)

Piyush Jain
Piyush Jain

Reputation: 1986

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.

Upvotes: 1

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

Upvotes: 1

jeprubio
jeprubio

Reputation: 18032

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">

Upvotes: 3

Related Questions