css - angular-6-datatable 的自定义 CSS
问题描述
我正在使用Angular-6-datatable。我想为表头和分页器图标应用一些自定义 CSS。我们如何使用自定义 CSS 覆盖当前 CSS我有一个全局 css 文件,我在其中添加“a”标签的颜色。在他们使用的包中
@Input("by") sortBy: string;
并将其附加到模板中
<a style="cursor: pointer;color: #ffffff;" (click)="sort()" class="text-nowrap">
<ng-content></ng-content>
<span *ngIf="isSortedByMeAsc" class="glyphicon glyphicon-triangle-top" aria-hidden="true"></span>
<span *ngIf="isSortedByMeDesc" class="glyphicon glyphicon-triangle-bottom" aria-hidden="true"></span>
</a>
当我检查没有颜色属性的元素时,我尝试在运行时在模板中给出颜色。
这是 stackblitz 链接:stackblitz Application
解决方案
通过在 style.css 中添加以下代码,我们可以覆盖该属性
table > thead > tr> th > mfdefaultsorter > a {
color: #ffffff !important;
font-weight: bold;
}
推荐阅读
- python - 即使 pandas 中没有值也创建额外的行
- c++ - 我可以将表达式存储为双精度吗?(或任何变量)
- c# - ,net core 3.1 AddAuthorization 方法未找到
- c# - 如何防止 MS Word 文档中出现新行?
- amazon-web-services - Cloudfront 403 绕过
- javascript - D3 按钮输入更改数据(堆积条形图)
- file - 方案:使用 open-i/o-file 函数
- c - 斐波那契函数的尾递归版本
- arrays - 如何访问或遍历嵌套的对象数组,这些对象有时可能是无限的,或者用户在nodejs中的json数组对象中不断添加?
- apache-spark - 在数据框上调用 createOrReplaceGlobalTempView 时出现问题