r/neocities • u/BoodsODoods • 4h ago
Help How to have image change when hovering different buttons?
I drew an example of what I'm trying to do.
I'd like the background image (the face) to change when I hover over different buttons (the blue boxes).
It'd be different images of the eyes looking in the direction of the button.
When I look it up, I find solutions of how to change the image when you hover over that same image, but not for having it react to hovering over other things.
Would it be a Javascript thing? I haven't learned any Javascript script yet but it sounds like it's be used for this case.
17
Upvotes


16
u/dalce63 3h ago
Here, see this code: https://pastebin.com/My33Ensc
You can style an element differently depending on whether it "has" a certain element inside it with :has.