I'm building a portfolio site for myself and I made a custom cursor that follows the default one, by creating an empty div, styling it as a small circle, and making it trail behind the default cursor with Javascript. All of that works fine.
The problem is that once the cursor moves over an image, the circle is displaying under it.
HTML
<div class="cursor"></div> <img src="https://steamuserimages-a.akamaihd.net/ugc/268338039154053677/D41BD0C4419DBF35C84CB17B2737B065504B1858/" alt=""> CSS
.cursor { height: 15px; width: 15px; border: 1px solid #0b0d0f; border-radius: 50%; position: absolute; transition-duration: 200ms; transition-timing-function: ease-out; pointer-events: none; } JavaScript
const cursor = document.querySelector('.cursor'); document.addEventListener('mousemove', e => { console.log(e); cursor.setAttribute("style", "top: "+(e.pageY - 10)+"px; left: "+(e.pageX - 10)+"px;") }) I would expect the custom cursor to hover over the image along with the default cursor, but instead is displays under it.
z-indexproperty?