我正在做一个asp。net mvc-5网络应用程序。我的共享布局视图中有以下内容:-
<link id="bs-css" href="~/Content/css/bootstrap-cerulean.css" rel="stylesheet">
<link href="~/Content/css/charisma-app.css" rel="stylesheet">
<link href="~/Content/css/bootstrap-responsive.css" rel="stylesheet">
<link href="~/Content/start/jquery-ui-1.10.3.custom.min.css" rel="stylesheet" />
@Styles.Render("~/Content/templete")
因此,我主要是先参考内置的bootstrap.css文件,然后再参考捆绑包
@Styles.Render("~/Content/templete")
其中包含我们的site.css。所以这意味着站点。css应该覆盖内置的.css文件,因为我引用的是站点。css在他们后面。。。
现在我面临的问题是,我在我的site.css中定义了以下样式:-
.input-validation-error {
border: 1px solid #ff0000;
background-color: #ffeeee;
}
如果输入有任何验证错误,则显示红色边框。现在在我的应用程序中,我不会得到如下错误行为:-
如图所示,与下拉字段不同,输入字段将没有任何红色边框。现在,如firebug所示,以下css规则在引导程序cerulean中定义。css将覆盖站点。css样式(尽管我在引导程序cerulean.css之后引用了site.css):-
textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
background-color: #ffffff;
border: 1px solid #cccccc;
border-radius: 3px;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset;
transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s;
}
select, textarea, input[type="text"], input[type="password"], input[type="datetime"], input[type="datetime-local"], input[type="date"], input[type="month"], input[type="time"], input[type="week"], input[type="number"], input[type="email"], input[type="url"], input[type="search"], input[type="tel"], input[type="color"], .uneditable-input {
color: #555555;
display: inline-block;
font-size: 13px;
height: 18px;
line-height: 18px;
margin-bottom: 9px;
padding: 4px;
}
那么,有人能告诉我如何强制使用这种样式,以对输入字段产生预期效果吗?
.输入验证错误{
边框:1px实心#ff0000;
背景色:#ffeeee;
}