1

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:

enter image description here

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/

0

3 Answers 3

1

I think you are probably looking for something like this http://jsfiddle.net/ssL1yydx/48/

#left-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 150px;
    background: #f1f1f1;
}
.btn-group {
    margin-left: 10px;
    margin-top: 30px;
}

#main-content{
    position: fixed;
    top: 0;
    bottom: 0;
    left: 150px;
    right: 0;
}

.scroll {
 overflow-y: scroll;  
 max-height: 100%;
}

and added this wrapper class to the content that may be too long:

<div class="scroll">
Sign up to request clarification or add additional context in comments.

3 Comments

This still doesn't let the menu on the left scroll if the content in the menu is high. jsfiddle.net/9dpdbgb5
Sorry, misinterpreted the request. Updated the answer to reflect it.
Apologies for making it unclear. What I meant was that the left menu could become super high (so needs an overflow: auto). The dropdown height doesn't matter. I'll update the MP
0

Turns out the real answer is that you cannot mix overflow-x:visible; and overflow-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/

Comments

0

You should increase the z-index for #left-menu and add: #left-menu .dropdown-menu { height:150px; overflow-y:auto; }

jsFiddle

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.