我使用 jQuery Validate 插件来突出显示错误。它用红色替换文本的颜色,这对于除一个 - 之外的所有元素都可以.help-block
,它应该保持蓝色。
这是没有错误的代码:
<div class="control-group">
<label class="control-label" for="place-of-birth">Place of birth</label>
<div class="controls">
<p class="help-block">Please input place of birth below, 2-80 symbols</p>
<input type="text" class="input-xlarge" id="place-of-birth" name="place-of-birth" minlength="2" maxlength="80" autocomplete="off">
</div>
</div>
这是错误消息:
<div class="control-group error"> <!-- STYLE IS CHANGED HERE -->
<label class="control-label" for="place-of-birth">Place of birth</label>
<div class="controls">
<p class="help-block">Please input place of birth below, 2-80 symbols</p>
<input type="text" class="input-xlarge" id="place-of-birth" name="place-of-birth" minlength="2" maxlength="80" autocomplete="off">
<div class="help-block" generated="true" for="place-of-birth">Please enter at least 2 characters.</div> <!-- THIS LINE IS ADDED -->
</div>
</div>
我试图用以下 CSS 覆盖它:
.control-group .error .help-block { color: blue; }
但这没有帮助。演示。
这里有什么问题?