I'm totally new to coding, i'm trying to make a website where when you hover the mouse over a link the the link (a) becomes bigger, but the tricky thing is that i want the hover to affect the sibling right next to the active hover. Right now i'm coding in CSS but maybe i need to use JavaScript instead? Please help :)
Here is what i have written already:
<ul>
<li><a href="">Tema 2</a></li>
<li><a href="">Tema 3</a></li>
<li><a href="">Tema 4</a></li>
<li><a href="">Tema 5</a></li>
<li><a href="">Tema 6</a></li>
</ul>
a {
color: var(--font);
font-size: 100%;
opacity: 0.7;
transition: color 0.5s, font-size 0.5s, opacity 0.5s;
}
a:hover {
color: var(--font);
font-size: 150%;
opacity: 1;
}
a:hover + a {
font-size: 125%;
}
a:not(:hover) {
font-size: 100%;
}
a:hover ~ a {
font-size: 100%;
}
I tried the code shown above, i think that the code is not precise enough, because i'm grabbing all a's, i just seems like a lot of work to give all the a's a class and then write, when sibling no. 1 is active then sibling no. 2 is at 125% font size. And when Sibling no. 3 is active then sibling no. 2 and 4 is at 125%, but right now that is how far my knowlegde reaches...
Hope it makes sense, and sorry for errors, english is not my first language :)