我创建了一个风格化的页面,并且已经更改了默认光标,但是当您将鼠标悬停在链接上时,它会返回到标准“指针”。我想改变标准指针,就像我使用默认光标一样。我尝试了一些我发现的JavaScript,但它似乎没有工作。在更改默认光标后更改指针
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../css/basic.css">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
var elms = document.getElementsByTagName("*");
var n = elms.length;
for(var i = 0; i < n; i ++) {
if(window.getComputedStyle(elms[i]).cursor == "pointer") {
elms[i].style.cursor = "url(../img/cursor.png)";
}
}
</script>
</head>
<body>
<a>
<a>
</body>
</html>
,这是CSS光标
html{
min-width: 100%;
min-height:100%;
cursor: url(../img/cursor.png),auto;
}
body{
background-color: black;
cursor: url(../img/cursor.png),auto;
}
你能发布整个img链接吗? – imbondbaby
这是你的意思吗? 'file:/// J:/ Graphic/webfolio/img/cursor.png' –