如何从禁用的输入中删除背景,边框和不允许指针

Eri*_*icC 2 css twitter-bootstrap

我正在使用Bootstrap:在禁用状态下,如何删除表单字段中的背景,边框和不允许使用的指针?在不更改其他表单上禁用字段的情况下...

我尝试了一下,但没有成功(使用AngularJS):

HTML:

<input type="text" ng-disabled="toggle" ng-class="{'no-extras': toggle}" class="form-control" id="name" placeholder="Name" />
Run Code Online (Sandbox Code Playgroud)

和CSS:

.no-extras {
  border: 0;
  box-shadow: none;
  background-color: white;
  cursor: default;
}
Run Code Online (Sandbox Code Playgroud)

在此处查看代码http://plnkr.co/edit/1AuszJ?p=preview

ash*_*q.p 5

使用以下方法更改样式表内容:

.no-extras {
  border: 1 !important;
  box-shadow: none !important;
  background-color: white !important;
  cursor: default !important;
}
Run Code Online (Sandbox Code Playgroud)

您已将border设为0,这是错误的。不要修改bootstrap.css文件,因为它会更改所有禁用的字段。另外,添加!important会使样式设置优先于bootstrap提供的默认样式设置。