开发者

CSS validation class not applied

开发者 https://www.devze.com 2023-02-15 10:35 出处:网络
I\'m doing this to set a border around input fields: input[type=text], input[type=password], textarea { border: 1px solid #9BAF31;}

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号