html - 在 AngularJS 中禁用下拉列表时如何使背景颜色变为灰色

标签 html angularjs

I have a dropdownlist when a value is selected and a button is clicked it's get disabled fine but the background-color is not grey like textboxes, I need to make the background-color grey of a dropdownlist when it is disabled in AngularJS . JS

<select class="categories"  ng-model="Model.CurrentDowntime.CategoryId" ng-options="downtimeCategory.CategoryId as downtimeCategory.CategoryName for downtimeCategory in Model.DowntimeCategories" ng-disabled="Model.CurrentDowntime.EventId !== undefined" required="" >
<option value="">-------------------SELECT-----------------</option>
</select> 

最佳答案

在你的 CSS 中:

select[disabled] {
   background-color: #CCC;  //use your prefered color here
}

关于html - 在 AngularJS 中禁用下拉列表时如何使背景颜色变为灰色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25421456/

相关文章:

php - HTML2PDF 图片错误无法加载图片

asp.net - 如何将换行符从多行文本框更改为 HTML <br/> 标记?

javascript - 如何更改 dxDataGrid 上的文本 "Select all"?

angularJS:ui-router $state.go 仅适用于第一次点击

javascript - 带有 ui.router 的 Angular 嵌套 View

javascript - 在 angularjs 中注入(inject) $dialog 时出错

javascript - 从 <span> 内的 <span> 获取文本

jquery - 自定义对话框到特定位置

Firefox 中的 Html 5 日期选择器

javascript - 使用 Angular JS 通过 ajax 传递复选框数组