将 Font Awesome 图标分配给悬停时的光标
Assign Font Awesome icon to cursor on hover
当我将鼠标悬停在 div 上时,我想使用一个 Font Awesome 图标作为 cursor/mouse 指针。这可能吗?像这样:
.myClass:hover {
cursor: <--- here assign to the cursor the Font Awesome icon
}
根据documentation,只有这样才能实现自定义游标,
是通过使用 cursor: url();
所以,加上@RicardoRuiz 的回答:
- 有人创建了 fontawesome to png generator
- 下载 .png 图标,
- 将其存储在您的项目资产目录中或在线
e.g. dropbox
- 使用 CSS
cursor: url()
将图标图像用作光标。
当我将鼠标悬停在 div 上时,我想使用一个 Font Awesome 图标作为 cursor/mouse 指针。这可能吗?像这样:
.myClass:hover {
cursor: <--- here assign to the cursor the Font Awesome icon
}
根据documentation,只有这样才能实现自定义游标,
是通过使用 cursor: url();
所以,加上@RicardoRuiz 的回答:
- 有人创建了 fontawesome to png generator
- 下载 .png 图标,
- 将其存储在您的项目资产目录中或在线
e.g. dropbox
- 使用 CSS
cursor: url()
将图标图像用作光标。