标签按钮已分配了光标 css。我想根据 is_active 值覆盖光标 css 以禁用按钮。is_active 的值可能为 0 或 1。以下是 js/html 代码,请告诉我将光标 css 应用于按钮的正确方法。
$scope.ngStyleDisabled = function(status) {
if (status == 1) {
return {};
} else if (status == 0) {
return '{\'cursor\':\'not-allowed !important\',\'pointer-events\':\'none\'}';
}
}Run Code Online (Sandbox Code Playgroud)
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.23/angular.min.js"></script>
<button ng-style="{{ngStyleDisabled(item.is_active)}}">Action Button</button>Run Code Online (Sandbox Code Playgroud)
有一个应用程序div以背景颜色绘制s作为其图形.
这些div在屏幕上看起来很好但是div在打印到PDF时s会消失.
将问题追溯到Twitter Bootstrap CSS.当Bootstrap CSS不存在时,div打印正常.但是不要打印.看到这个JSFiddle:
我认为问题是Twitter CSS的这一部分.我想我需要覆盖background: transparent !important但不能为我的生活弄清楚如何.
这可能很简单.尝试background: opaque !important但是没有用,我似乎无法找到该background属性的允许值列表.
@media print {
* {
color: #000 !important;
text-shadow: none !important;
background: transparent !important;
box-shadow: none !important;
}
Run Code Online (Sandbox Code Playgroud)
background: transparent !important;CSS 的反义词是什么?
在angular2模板中,如果我写:
[ngStyle]="{'background-color': 'red'}"
Run Code Online (Sandbox Code Playgroud)
它按预期工作.但如果我写:
[ngStyle]="{'background-color': 'red !important'}"
Run Code Online (Sandbox Code Playgroud)
它不工作(也没有显示任何错误)