Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
418 views
in Technique[技术] by (71.8m points)

html - Custom cursor won't show in Chrome but works in Safari

I'm trying to use a custom cursor for my website. However, it only shows up on safari but not chrome. The website is online and the address is www.p3k4800.com I'd really appreciate the help! Thank you!!!

Here's the HTML

<!DOCTYPE html>
<html lang="en" dir="ltr" id="bleed">
  <head>
    <meta charset="utf-8">
    <title>Yuhan Hu</title>
    <style type="text/css">
body, html {
     cursor: url('c2.svg'),auto;
   }
</style>
<script src="http://code.jquery.com/jquery-latest.min.js"></script>
 <script src=app.js></script>
<link rel="stylesheet" href="style.css">
   </head>
  <body class="homeindex" >

    <div class="mix">
 <img src="sources/work1.1.jpg" id="home_video">
    <!-- <video controls autoplay id="home_video">
      <source src="sources/1.mp4" type="video/mp4">
    </video> -->
<div class="texts">
      <h1  class = "title"> Yuhan Hu </h1>
    <ul class = "items">
      <li class="subs"><a href="sub/works1.html">Works.1</li>
      <li class="subs"><a href="sub/works2.html">Works.2</li>
      <li class="subs"><a href="sub/works3.html">Works.3</li>
      <li class="subs"><a href="sub/works4.html">Works.4</li>
      <li class="subs"><a href="sub/works5.html">Works.5</li>
      <li class="subs"><a href="sub/polaroids.html">Polaroids</li>
      <li class="subs"><a href="sub/videos.html">Videos</li>

      <br>
      <br>

     <li class="subs"><a href="sub/info.html">Contact</li>

      </ul>
    </div>
      </div>
  </body>
</html>

and here's the css cursor part

.title{
  color: white;
 mix-blend-mode: difference;
font-family: "MyWebFont" ;
font-weight: bolder;
position: relative;
left: 20px;
animation: neon .08s ease-in-out infinite alternate;
cursor: url('sources/c.svg')
}

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Did you see this in the Chrome console?

[Deprecation] Custom cursors with size greater than 32x32 DIP intersecting native UI is deprecated and will be removed in M75, around June 2019. See https://www.chromestatus.com/features/5825971391299584 for more details.

DISCLAIMER: I can answer your question as to why its not working, but I do not claim to know what you can do to work around it, other than restrict your cursor to 32x32.

https://www.chromestatus.com/feature/5825971391299584

Custom cursors with widths or heights greater than 32 DIP will be removed if they intersect native UX (i.e. are not fully contained in the visual viewport).

Large cursors are being used abusively on the web, to confuse users (see https://crbug.com/880863). Specifically, large custom cursors can be used to cover important (sometimes security related) browser native UX with an arbitrary image to mislead users into thinking they are clicking outside the content area.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...