如何全局更改光标图像
How do I change the cursor image globally
我看过很多使用 CSS 的 "cursor:" 属性 的教程。然而,这主要是针对悬停在某物上时看到的光标。我需要在整个网站上普遍更改光标。我假设这使用 Javascript,但我不知道 Javascript,所以我需要一些帮助。
是的, 我知道这通常是一个糟糕的设计选择,这就是为什么我这样做的网站是个笑话。它旨在重现每一个 90 年代的网站。
为了更清楚地说明我想要什么,here 是我希望在网站上使用的图像列表。我想知道如何通用地更改光标,而不仅仅是特定元素。
只需将 CSS 光标 属性 更改为 html 或正文标记
html {
cursor: url("hyper.cur"), auto;
}
试试这个可能对你有帮助
<html>
<span style="cursor:auto">auto</span><br>
<span style="cursor:crosshair">cross-hair</span><br>
<span style="cursor:default">default</span><br>
<span style="cursor:e-resize">e-resize</span><br>
<span style="cursor:grab">grab</span><br>
<span style="cursor:progress">progress</span><br>
<span style="cursor:s-resize">s-resize</span><br>
<span style="cursor:se-resize">se-resize</span><br>
<span style="cursor:sw-resize">sw-resize</span><br>
<span style="cursor:help">help</span><br>
<span style="cursor:move">move</span><br>
<span style="cursor:n-resize">n-resize</span><br>
<span style="cursor:ne-resize">ne-resize</span><br>
<span style="cursor:nw-resize">nw-resize</span><br>
<span style="cursor:pointer">pointer</span><br>
<span style="cursor:text">text</span><br>
<span style="cursor:w-resize">w-resize</span><br>
<span style="cursor:wait">wait</span><br>
<span style="cursor:not-allowed">not-allowed</span><br>
<span style="cursor:no-drop">no-drop</span><br>
</html>
我看过很多使用 CSS 的 "cursor:" 属性 的教程。然而,这主要是针对悬停在某物上时看到的光标。我需要在整个网站上普遍更改光标。我假设这使用 Javascript,但我不知道 Javascript,所以我需要一些帮助。
是的, 我知道这通常是一个糟糕的设计选择,这就是为什么我这样做的网站是个笑话。它旨在重现每一个 90 年代的网站。
为了更清楚地说明我想要什么,here 是我希望在网站上使用的图像列表。我想知道如何通用地更改光标,而不仅仅是特定元素。
只需将 CSS 光标 属性 更改为 html 或正文标记
html {
cursor: url("hyper.cur"), auto;
}
试试这个可能对你有帮助
<html>
<span style="cursor:auto">auto</span><br>
<span style="cursor:crosshair">cross-hair</span><br>
<span style="cursor:default">default</span><br>
<span style="cursor:e-resize">e-resize</span><br>
<span style="cursor:grab">grab</span><br>
<span style="cursor:progress">progress</span><br>
<span style="cursor:s-resize">s-resize</span><br>
<span style="cursor:se-resize">se-resize</span><br>
<span style="cursor:sw-resize">sw-resize</span><br>
<span style="cursor:help">help</span><br>
<span style="cursor:move">move</span><br>
<span style="cursor:n-resize">n-resize</span><br>
<span style="cursor:ne-resize">ne-resize</span><br>
<span style="cursor:nw-resize">nw-resize</span><br>
<span style="cursor:pointer">pointer</span><br>
<span style="cursor:text">text</span><br>
<span style="cursor:w-resize">w-resize</span><br>
<span style="cursor:wait">wait</span><br>
<span style="cursor:not-allowed">not-allowed</span><br>
<span style="cursor:no-drop">no-drop</span><br>
</html>