0
我在嘗試在我的ASP.Net MVC
項目中更改所需的字段驗證器顏色。我的css文件中的跨度字段錯誤
在我的形式,我有一個必填字段驗證這樣的:
<span class="field-validation-error" data-valmsg-for="Date" data-valmsg-replace="true"><span for="Date" class="">The Date field is required.</span>
日期字段是必需的。
在我的CSS文件,我已經加入,
span.field-validation-error {
color: #b94a48;
font-weight: bold;
}
但驗證錯誤,顏色不是在瀏覽器中反映。 當我嘗試在Inspect元素中更改這樣的代碼時,一切正常。