Hiding the drop-down menu using the off-screen hidden technique

The basic idea is to absolutely position an element far, far away from the visible screen so that it isn't visible, but screen readers can still announce it. There's a lot more to learn about accessibility. I recommend that you start by checking out the article at https://css-tricks.com/places-its-tempting-to-use-display-none-but-dont/ for more information, at least on how to use off-screen hidden techniques, and then go from there with regard to accessibility:

Web accessibility is a topic with so much depth that it deserves a book of its own. So I cannot do it thorough justice ...

Get Mastering CSS now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.