html - 无法从 mat-chip 中删除悬停背景颜色
问题描述
我需要将悬停背景颜色删除为悬停时透明。
HTML :-
<div>
<mat-chip-list>
<mat-chip class="price-filter">Price <svg width="24"
height="24" viewBox="0 0 24 24" focusable="false" class="
NMm5M"><path d="M7 10l5 5 5-5H7z"></path></svg>
</mat-chip>
</mat-chip-list>
</div>
CSS :-
.price-filter{
border: solid;
border-color: #dad5d5;
border-width: thin;
background-color: transparent;
cursor:pointer;
color: var(--primary) !important;
}
.price-filter > mat-icon {
background-color: transparent;
opacity: 1;
}
.NMm5M {
fill: var(--primary) !important;
position: relative;
left: 11px;
}
.price-filter:hover{
background-color: transparent !important;
}
我想删除悬停时的灰色,如第二个链接中的屏幕截图所示。
解决方案
为什么简单的不改变类price-filter
中的悬停规则?
像:
.price-filter:hover{background-color:inherit!important;} // or want you want.
看到现场版本后编辑:
问题是代码:
.mat-chip.mat-standard-chip::after {
background: #0000;
}
如果您将其更改为透明,则所有工作都按您的意愿进行。
推荐阅读
- python-3.x - tls消息python
- node.js - 如何获取 JSON 对象列表?
- ios - 为什么在 TextField 键盘中输入的每个字母都关闭后以及如何更好地修复它?
- javascript - 将 dateTime 字符串解析为 UTC
- node.js - 怎么取?再次
- azure - 工作区身份验证:多个令牌与条件匹配
- testing - 单击赛普拉斯中的按钮
- bash - 为什么我在 bash while 循环后得到很多换行符?
- python - 使用 Gmail API 和服务帐户凭据读取 Gmail 收件箱
- google-apps-script - 模糊的 Google Apps 脚本行为