Advanved dropdown menu question
I have a menu with some buttons that show the dropdowns on hover. How can I change the style of the buttons when the dropdown is hovered? Btw, I do not use Ids or classes, it. must work with pure selectors.
Hello, Manuel 48 ! Please, attach your code, and then people will be able to help you.
Thanks Alexander Sokolov, but i can't show you the code right now. I just need the selector to select the element right above the original element
Also, "right above" could mean parent or sibling, but we can't tell without seeing your code.
Hey Janning, here is a mockup of the structure. <div> <button>On hover, show div in parent</button> <div><! - - On hover, show button right above--> <p>An element...</p> </div> </div>
Hi Manuel, I built this on the phone app, so I haven't tested it on a desktop, but it should work. You could probably swap out the p in the CSS tab for div, but it's hard to know which was intended to be the "dropdown". HTML5 has a <nav> element that might be helpful so you can spare the div. https://code.sololearn.com/WsSm7pP40PKq/?ref=app Much faster if you use the Code Playground, by the way. ☺ Hope this helps! (PS I highly recommend using classes and IDs. Otherwise, you'll run out of pure selectors really fast.)