css - angular-material 按钮更改悬停背景
问题描述
我有一个角材料链接按钮元素:
<a mat-button>Link</a>
我想将其悬停背景更改为粗体白色,因此在我的全局 styles.css 文件中我定义了:
.mat-button-focus-overlay {
background: rgba(255, 255, 255, 0.8)!important;
}
链接本身没有任何额外的样式。我可以看到悬停时的背景颜色确实变成了白色,但是变成了非常淡的白色,尽管不透明度设置为 0.8。有没有办法解决这个问题?
谢谢。
解决方案
在您的全局 styles.css 中,您有机会直接覆盖 mat-button 的作用 - 正常和悬停:例如:
$white: white;
.mat-button {
color: $white;
background: $white;
}
.mat-button:hover {
color: $white;
background: $white;
}
推荐阅读
- angular - docker-compose:尝试使用 oauth 身份验证安装 MDBoostrap Pro 时出错
- reactjs - 使用 Jest 测试处理 webpack 加载器语法:感叹号 raw-loader
- amazon-web-services - k8s服务开放端口后大量连接日志
- ssl - 在 Tomcat 5.5 Http11Protocol 中启用 TLS 1.2
- asp.net - 如何在 asp.net mvc core 中显示自定义的 404 错误页面
- python - 更改 3D 图像像素的颜色并保存
- mqtt - 如何从 MQTT 消息发送电子邮件附件?
- javascript - 按公共属性对对象数组进行分组
- javascript - 如何干燥 VueJS + Vuelidate 服务器端验证错误代码?
- amazon-web-services - Terraform AWS ALB 侦听器规则路径