【发布时间】:2020-05-19 18:42:01
【问题描述】:
对于我的项目,我使用了一些来自 devextreme 的外部 CSS。现在,我想覆盖一些规则。为此,我检查了外部 css 并找到了要覆盖的类。我使用这样的 css 文件:
<link href="~/css/devextreme/dx.greenmist.css" rel="stylesheet" />
<link href="~/css/customized.css" rel="stylesheet" />
在customized.css 中我更改了一个属性:
.dx-treeview-toggle-item-visibility {
font: 14px/1 DXIcons;
font-size: 22px;
text-align: center;
line-height: 22px;
color: #333;
width: 21px;
height: 32px;
top: 0;
right: 0px; /*new property instead of left: -4px*/
}
如果我运行应用程序,我看到最顶层的规则是这个自定义规则,但也有原始规则,我的自定义规则没有应用(见图):
为什么我的自定义 CSS 规则没有应用?
【问题讨论】:
-
应用...左右是不同的属性
-
因为您没有覆盖它,所以您需要将
left: auto设置为您的CSS 规则。规则是增量的,如果您不指定要覆盖的规则,新规则不会完全覆盖旧规则
标签: html css devextreme