24 Replies
Ones for the li one is for the ahref
ik but i dont understand the result, its really simple and yet i dont get it
I mean why li doesnt change it to orange too?
Put it in a codepen
We can help better understand
there you go
It's only going to change when it's hovered which it does
but if i comment a:hover, why li:hover doesnt work?
because inheritance goes down not up
Una Kravets
CSS-Tricks
Solved with CSS! Dropdown Menus | CSS-Tricks
A common UI pattern that we see on the web are dropdown menus. They’re used to display related information in pieces, without overwhelming the user with buttons, text, and options. Somewhere that we see these a lot is inside of headers or navigation areas on websites. Let’s see if we can make one of these menus with CSS alone.
Good article for pretty much same method
that made it more confusing
They use :focus-within it looks like
li doesn't have background-color so hover on li doesn't change anything
but they used li:hover on this website.
???
what are you trying to achieve ?
i have the result but dont know how i got it😁
if you want to change property of a element on hover you need to select the same element you can't select it's parent so if
a
has bg-color you need to use a:hover
to change the bg-color
if the bg-color is on li
you need to use li:hover
like i don't see why are you so confused tbh 😄
you can't have bg-color on a
and put hover on it's parent li
and expect it to workthanks man, this line made it nice n clear
idk the thing was small but i just...
one more thing
does this mean that when hover over list with class navigation, set display of subNav to block?
when you hover over
li
that parent element has navigation
class you will add that display property to element with class subNav
thanks a lot @mannix_
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View