【发布时间】:2021-02-03 16:39:49
【问题描述】:
我有一个场景,我必须使用特定的材质图标作为垫按钮的光标指针。我不知道如何实现这一目标。任何帮助将不胜感激。
<button mat-button>
<button>
【问题讨论】:
-
可以用svg版吗?
-
不,我们可以使用
标签: css angular angular-material2
我有一个场景,我必须使用特定的材质图标作为垫按钮的光标指针。我不知道如何实现这一目标。任何帮助将不胜感激。
<button mat-button>
<button>
【问题讨论】:
标签: css angular angular-material2
没有办法使用材料来做到这一点。您需要通过添加以下内容来更新 CSS:
you-mat-element {
cursor: pointer;
}
我 fork the original Angular example 并进行了更改以进行现场演示:https://stackblitz.com/edit/angular-eynqmo
【讨论】:
在 css 文件中,将以下行添加到您的 css 类中:
.your-css-class { cursor: URL('path-to-png-or-svg-file'), auto; }
请注意,png 或 SVG 文件可以从以下链接的 google 材料图标页面下载:
Google Material Icons
【讨论】: