【问题标题】:angular-material button change hover backgroundangular-material 按钮更改悬停背景
【发布时间】:2019-06-28 07:13:09
【问题描述】:

我有一个角材料链接按钮元素:

<a mat-button>Link</a>

我想将其悬停背景更改为粗体白色,因此在我的全局 styles.css 文件中我定义了:

.mat-button-focus-overlay {
   background: rgba(255, 255, 255, 0.8)!important;
}

链接本身没有任何额外的样式。我可以看到悬停时的背景颜色确实变成了白色,但是变成了非常淡的白色,尽管不透明度设置为 0.8。有办法解决吗?

谢谢。

【问题讨论】:

标签: css angular-material


【解决方案1】:

在您的全局 styles.css 中,您有机会直接覆盖 mat-button 的作用 - 正常和悬停: 示例:

$white: white;

.mat-button {
  color: $white;
  background: $white;
}

.mat-button:hover {
  color: $white;
  background: $white;
}

【讨论】:

    猜你喜欢
    • 2016-08-13
    • 1970-01-01
    • 2017-07-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-12-15
    • 2015-01-14
    • 2017-04-12
    相关资源
    最近更新 更多