CSS Drop Down Menu hidden behind horizontal scrollbar

Sorry I can’t resist :slight_smile:

If I have given advice then I have taken time to think and help out as best I can. If you missed the advice the first time time around (or didn’t understand it) then perhaps you should go back and re-read my answers more fully now that you have found out the same for yourself. :wink:

I already pointed that out to you at the start and then tested it for you to show that it was not possible and you would run into the issue as shown in my codepen and as your current demonstration.

I’m not sure what you don’t understand when I say there is no way to make a drop down menu work properly inside a scrollable element and have the drop menu remain outside the scrollable element and in touch with the trigger point when the menu has scrolled sideways. It is not possible to do this unless you write some JS to move the menu to the new position of the scrolled item

I’ve been doing these menus for 25 years and I can tell you that you cannot do what you are attempting in pure CSS. Its not desirable either unless you can build in some accessibility features but that’s a whole set of other questions that need to be addressed.

Looking at your code you are obviously at a very early stage in your html and css journey and while this is a good chance for you to learn how to do things it is not good to try and achieve the impossible with limited knowledge.

Lose the scroll container and instead make sure your menu doesn’t overflow.

If you must have a scrolling sideways menu with a dropdown then you better start learning some advanced JS to do this.

Sorry if the above sounds a bit harsh but I’d rather you didn’t waste years on something that can’t possibly work in the manner you are attempting.:slight_smile:

5 Likes