Abhijit Borkakoty Abhijit Borkakoty - 3 months ago 9
CSS Question

Css class getting added through php but without styles

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

Answer

Try this:

.error_field
{
    color:red !important;   // Now this will override the default css and apply yours
}
Comments