【问题标题】:How to use material icons as mouse cursor image如何使用材质图标作为鼠标光标图像
【发布时间】:2021-02-03 16:39:49
【问题描述】:

我有一个场景,我必须使用特定的材质图标作为垫按钮的光标指针。我不知道如何实现这一目标。任何帮助将不胜感激。

 <button mat-button>
 <button>

【问题讨论】:

  • 可以用svg版吗?
  • 不,我们可以使用

标签: css angular angular-material2


【解决方案1】:

没有办法使用材料来做到这一点。您需要通过添加以下内容来更新 CSS:

you-mat-element {
   cursor: pointer;
}

我 fork the original Angular example 并进行了更改以进行现场演示:https://stackblitz.com/edit/angular-eynqmo

【讨论】:

【解决方案2】:

在 css 文件中,将以下行添加到您的 css 类中:

.your-css-class { cursor: URL('path-to-png-or-svg-file'), auto; }

请注意,png 或 SVG 文件可以从以下链接的 google 材料图标页面下载: Google Material Icons

【讨论】:

    猜你喜欢
    • 2022-07-12
    • 1970-01-01
    • 2012-06-07
    • 2010-10-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-04-19
    • 2021-11-15
    相关资源
    最近更新 更多