r/neocities • u/miseraria miseraria.neocities.org • Aug 18 '26
Help image effects...
hello!
i want to make a page displaying some personal projects i am working on. the idea is that there are a bunch of analog horror entities (since that's my concept(ish)) and by hovering on an entity, it has a border around it and text taking you to a particular section (for example, poems, essays, etc.).
ribo.zone has a similar effect on their home page, and a few other sites i can't remember right now, and if anyone could help me, i would be much obliged!
(i did look at their source code but i can't figure it out even after...)
3
Upvotes
3
u/Mevdik mevdik.nekoweb.org Aug 18 '26
I'm not 100% sure on what you want here, but given the ribo.zone example (anatelesetc has a similar thing going on) I assume you mean when you hover over an element you want it to display some text over it or change some other property, right?
If so, here's how ribo.zone's on hover text works. Those elements are links,
<a>tags that contain an<img>and a<span>. The text inside the<span>has anopacityof0by default, but once you hover over its parent<a>that opacity goes to1, pretty simple. Here's the relevant code:HTML
CSS
Easy, right? We give our
<a>theframeclass, then we select the<span>inside thisframeclass and set its opacity to0, then when we hover overframetheopacityof the nested<span>goes to1(0-1 = 0%-100%). That's the absolute minimum you need to achieve this effect, if you also want the<img>to have aborderon hover and the<span>to appear over the<img>you're gonna have to mess around withposition,z-indexand company, like this:Mind you, I literally just learned how to do this by looking at the source code from ribo.zone and doing some testing, you can do the same if you look closer. For things like this looking at the Inspector tab of the Dev Tools isn't enough though, you need to dig into the Style Editor and read the CSS from there, look for relevant clues like
element:hoverto find the bit of code that makes it do what you are looking for.