Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
July 10, 2021 04:56 pm GMT

Create a custom cursor for your website

Hi, Do you think about how you can create a custom cursor for your website?
This section will show you how to create custom cursors quickly and easily. We must take simple step (Create a HTML file and paste the codes below into it)

    <div class="mouse" id="mouse">        <img src="https://i.postimg.cc/NFx1b2f7/pack2586.png" alt="">    </div>    <style>        body,        html {            width: 100%;            height: 100%;            overflow: hidden;        }        * {            cursor: none;        }        .mouse {            width: 20px;            height: 20px;            background-color: none;            position: absolute;            top: 0;            left: 0;            z-index: 1000;        }        .mouse img {            width: 40px;        }    </style>    <script>        document.onmousemove = function (e) {            var mouse = document.getElementById("mouse");            console.log(mouse.style);            mouse.style.left = e.pageX + 1 + "px";            mouse.style.top = e.pageY + 1 + "px";        }    </script>

Original Link: https://dev.to/hosseinmobarakian/create-a-custom-cursor-for-your-website-4lpb

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To