I’m creating a website where you have a menu on the left that can become super long, so I need to have the overflow-y: auto
(and I put overflow-x: visible !important
).
Inside that menu I have a dropdown. But the dropdown is cut off on the right due to the overflow from the left menu. See image:
How can I make the dropdown appear properly? ie The dropdown shouldn’t be cut on the right hand side.
Here is a JsFiddle: http://jsfiddle.net/ssL1yydx/41/
3
Answers
I think you are probably looking for something like this http://jsfiddle.net/ssL1yydx/48/
and added this wrapper class to the content that may be too long:
Turns out the real answer is that you cannot mix
overflow-x:visible;
andoverflow-y:auto;
and that’s actually how it’s in the spec.Check this post CSS overflow-x: visible; and overflow-y: hidden; causing scrollbar issue
So probably the best and easiest to maintain solution would be to allow your left sidebar enough space to house everything that it needs to, in which this case I’ve set the width to 200px instead of 150px.
http://jsfiddle.net/t67jg2dh/
You should increase the
z-index
for#left-menu
and add:#left-menu .dropdown-menu { height:150px; overflow-y:auto; }
jsFiddle