0

I am trying to validate forms through php and whenever an error occurs I want the input field to be bordered by red color. The class is getting added but styles arent showing. The style is getting cancelled. Any advice to tackle this??

Below is a screrenshot

enter image description here

0

1 Answer 1

1

Try this:

.error_field
{
    color:red !important;   // Now this will override the default css and apply yours
}
Sign up to request clarification or add additional context in comments.

1 Comment

However this will work but at the same time, he/she should need to know why its getting overriding. Additionally, We should avoid using !important unless they are absolutely necessary .. james.padolsey.com/css/dont-use-important

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.