我正在使用Bootstrap:当处于禁用状态时,如何在表单字段中删除背景,边框和不允许指针? 在其他表单上禁用相同的禁用字段...
我试过这个,没有任何成功(使用AngularJS):
HTML:
<input type="text" ng-disabled="toggle" ng-class="{'no-extras': toggle}" class="form-control" id="name" placeholder="Name" />和CSS:
.no-extras { border: 0; box-shadow: none; background-color: white; cursor: default; }请参阅此处的代码http://plnkr.co/edit/1AuszJ?p=preview
I am using Bootstrap: How can I remove the background, border and the not-allowed-pointer in form fields when in disabled state? Without altering the same on other forms disabled fields...
I tried this, without any success (using AngularJS):
HTML:
<input type="text" ng-disabled="toggle" ng-class="{'no-extras': toggle}" class="form-control" id="name" placeholder="Name" />And CSS:
.no-extras { border: 0; box-shadow: none; background-color: white; cursor: default; }See code here http://plnkr.co/edit/1AuszJ?p=preview
最满意答案
使用以下方法更改样式表内容:
.no-extras { border: 1 !important; box-shadow: none !important; background-color: white !important; cursor: default !important; }您已将边框设为0,这是错误的。 不要修改bootstrap.css文件,因为它会更改所有禁用的字段。 此外,添加!important使您的样式优先于bootstrap提供的默认样式。
Change your stylesheet content with this:
.no-extras { border: 1 !important; box-shadow: none !important; background-color: white !important; cursor: default !important; }You have given border as 0 which is wrong. Do not modify your bootstrap.css file as it will alter all disabled fields. Also, adding !important gives precedence to your styling over default styling provided by bootstrap.
如何从禁用的输入中删除背景,边框和不允许的指针(How to remove background, border and not-allowed-pointer from disabled input)我正在使用Bootstrap:当处于禁用状态时,如何在表单字段中删除背景,边框和不允许指针? 在其他表单上禁用相同的禁用字段...
我试过这个,没有任何成功(使用AngularJS):
HTML:
<input type="text" ng-disabled="toggle" ng-class="{'no-extras': toggle}" class="form-control" id="name" placeholder="Name" />和CSS:
.no-extras { border: 0; box-shadow: none; background-color: white; cursor: default; }请参阅此处的代码http://plnkr.co/edit/1AuszJ?p=preview
I am using Bootstrap: How can I remove the background, border and the not-allowed-pointer in form fields when in disabled state? Without altering the same on other forms disabled fields...
I tried this, without any success (using AngularJS):
HTML:
<input type="text" ng-disabled="toggle" ng-class="{'no-extras': toggle}" class="form-control" id="name" placeholder="Name" />And CSS:
.no-extras { border: 0; box-shadow: none; background-color: white; cursor: default; }See code here http://plnkr.co/edit/1AuszJ?p=preview
最满意答案
使用以下方法更改样式表内容:
.no-extras { border: 1 !important; box-shadow: none !important; background-color: white !important; cursor: default !important; }您已将边框设为0,这是错误的。 不要修改bootstrap.css文件,因为它会更改所有禁用的字段。 此外,添加!important使您的样式优先于bootstrap提供的默认样式。
Change your stylesheet content with this:
.no-extras { border: 1 !important; box-shadow: none !important; background-color: white !important; cursor: default !important; }You have given border as 0 which is wrong. Do not modify your bootstrap.css file as it will alter all disabled fields. Also, adding !important gives precedence to your styling over default styling provided by bootstrap.
发布评论