I'm doing this to set a border around input fields:
input[type=text], input[type=password], textarea { border: 1px solid #9BAF31;}
I have client-side validation that adds this class when errors occur:
.input-validation-error {
border: 1px solid #ff0000;开发者_如何学Python
background-color: #ffeeee;
}
But only the background is set. The border is still the original color. How can i set it with the validation color?
Have you tried
input[type=text].input-validation-error ,input[type=password].input-validation-error, textarea.input-validation-error
{
border: 1px solid #ff0000;
background-color: #ffeeee;
}
You need to make the rule you want to apply at least as specific as the existing rules.
You could try to add the .input-validation-error above the "input[type=text],input[type=password], textarea". Also, what does FireBug says when you inspect the element?
精彩评论