修改光标指针 请晰度的问 题 请教!

    &:hover {
      cursor: url('../../assets/img/selectRow.png'),auto;      // 这里有没办法改图的大小, 图片太小清晰度很差。.cur 格式也一样
      // cursor: url('../../assets  /img/selectROW.svg'), auto;  // svg格式 无效
    }

能用矢量图 是最好, 如果用Png, 请教怎么来保证 这个 鼠标指针的清晰度

下面这个 箭号,外面有白色边线,有些糊啊。

img

这应该是图标文件本身的问题,换个图标文件试下
指针图标图片大小最好是32*32的大小,如果太大了缩小之后就会不清晰

图片挂了

图挂了
1.应该是图片问题,换图试
2.上iconfont上找相同或相似矢量图进行替换

因为你插入的是background 背景图,背景图 的大小和你的元素大小有关

    &:hover {
      cursor: url('../../assets/img/selectRow.png'),auto;      // 这里有没办法改图的大小, 图片太小清晰度很差。.cur 格式也一样
      // cursor: url('../../assets  /img/selectROW.svg'), auto;  // svg格式 无效
width:16px;
height:16px;
    object-fit: contain; //保持原图比例 或者 用 cover 铺满
    }

自己慢慢调试下

1、大小不能大于32*32

2、最好是 ico,cur格式

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632

img

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box:hover  {
            width: 100px;
            height: 100px;
            background-color: #f00;
            cursor: url(1.png), auto;
        }
    </style>

</head>

<body>
    <div id="box">暂无数据</div>
</body>

</html>

<svg t="1656930825525" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1822" width="32" height="32"><path d="M511.5 42.7C252.7 42.7 42.1 253.2 42.1 512s210.6 469.3 469.3 469.3S980.8 770.8 980.8 512 770.3 42.7 511.5 42.7z m0 853.3c-211.8 0-384-172.3-384-384s172.3-384 384-384 384 172.3 384 384-172.3 384-384 384z" fill="#BDBDBD" p-id="1823"></path><path d="M755.6 267.8c-27-27-67.3-35-102.6-20.2L402.3 352.4c-23 9.6-40.9 27.5-50.5 50.4L247.1 653.6c-14.7 35.3-6.8 75.5 20.2 102.6 18 18 41.9 27.6 66.2 27.6 12.2 0 24.5-2.4 36.3-7.3l250.8-104.8c22.9-9.6 40.8-27.4 50.5-50.4l104.8-250.8c14.7-35.4 6.8-75.6-20.3-102.7z m-58.5 69.7L592.4 588.3c-0.9 2.1-2.5 3.7-4.6 4.6L337 697.7c-1.3 0.5-5.3 2.2-9.3-1.8-4-4-2.4-8-1.8-9.3l104.8-250.8c0.9-2.1 2.5-3.7 4.6-4.6L686 326.3c0.6-0.3 1.9-0.8 3.5-0.8 1.7 0 3.7 0.6 5.8 2.6 4 4.1 2.4 8.1 1.8 9.4z" fill="#BDBDBD" p-id="1824"></path><path d="M511.5 512m-42.7 0a42.7 42.7 0 1 0 85.4 0 42.7 42.7 0 1 0-85.4 0Z" fill="#BDBDBD" p-id="1825"></path></svg>


<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        #box:hover  {
            width: 100px;
            height: 100px;
            background-color: #f00;
            cursor: url(1.svg), auto;
        }
    </style>

</head>

<body>
    <div id="box">暂无数据</div>
</body>

</html>