r/neocities • • 15d ago

Question Need help with cursor

How do I add a custom cursor to my page? When I tried I couldn't get it to work. Pls help 😣🙏 I'm a total beginner with this thing.

3 Upvotes

7 comments sorted by

2

u/Dakota-Batterlation https://perilune.space 14d ago

It can be a bit tricky (recently helped someone here troubleshoot cursors, as well as my own site). Please drop a link to your site so we can mess with it instead of playing telephone.

1

u/lullaby-0 11d ago edited 11d ago

I'm currently testing it on an entirely new html file right now to get it to work, so it's kind of empty. https://nirilixia.neocities.org/tests/test

2

u/Dakota-Batterlation https://perilune.space 11d ago

The CSS cursor works, it just wasn't showing up because there weren't any elements on the page. It has to be in front of *something*, even if it's just <html> or <body>. So I temporarily set body {width: 100vw; height: 100vh;} so that it'd fill the screen, and the cursor (and background image) indeed work.

0

u/lullaby-0 11d ago edited 11d ago

So what should I change in the css? I don't rlly know much about it so I don't quite get it.

0

u/lullaby-0 11d ago

I got it to work, thank youu🙏

3

u/DeviantPost 15d ago

What does your code look like for trying to add the cursor? on my page it's: html { cursor: url('filename/cursorimage.png') auto; }. 

Another thing is cursor images have to be 128 × 128px or smaller. An issue I ran into was that I didn't scale the png I used down properly, so make sure the image is actually 128 × 128 or smaller or it won't show up.  

2

u/worksbeforedeath worksbeforedeath.neocities.org 12d ago

i am currently making custom cursors to sell & had to figure this out myself both for my own website & to add it the documents to sell.

https://kiunlo.neocities.org/cursor-tutorial is the tutorial i followed on how to create them.

as for adding it into css, you put the default/auto cursor into the body tag. you put the cursor used for links into the a:hover tag. you put the cursor used for text under p, h1, h2, h3, h4, h5, h6. for simplicity sake, i just put all of that into 1 tag on the top so it would be prioritized. i will warn, if you have any iframes or widgets on your site the cursor will not show on those, and that is completely normal & fine.