Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you stop a dropdown menu from going up?

I have a dropdown menu that's towards the top of the page for most screen sizes, but on smaller screens, such as a laptop, the menu is in the middle of the screen, and because of this, the dropdown list is going above the selector. I want a dropdown that will consistently go down, no matter where on the page it is. Is this at all possible?

like image 301
Chad Avatar asked Sep 11 '25 05:09

Chad


2 Answers

Drop-downs are rendered by the Browser/OS. You cannot control this type of behaviour using CSS or JavaScript.

like image 121
Diodeus - James MacFarlane Avatar answered Sep 13 '25 19:09

Diodeus - James MacFarlane


As it's an element left to the browser to render, no, it's not possible (at least not as far as standards are concerned).

Your best option is to use an HTML substitute for the dropdown menu - this can be achieved with CSS and Javascript, though multiple javascript/jQuery libraries alread exist to perform this task.

like image 23
Death Avatar answered Sep 13 '25 18:09

Death