Scrollable Menu with Bootstrap - Menu expanding its container when it should not

后端 未结 6 1117
野性不改
野性不改 2020-11-29 15:39

I tried this method (their fiddle) to enable scrollable menu with Bootstrap, but with that approach, the scrollable menu expands its container -- fiddle -- the non-scrollabl

6条回答
  •  情书的邮戳
    2020-11-29 16:32

    For CSS, I found that max height of 180 is better for mobile phones landscape 320 when showing browser chrome.

    .scrollable-menu {
        height: auto;
        max-height: 180px;
        overflow-x: hidden;
    }
    

    Also, to add visible scrollbars, this CSS should do the trick:

    .scrollable-menu::-webkit-scrollbar {
        -webkit-appearance: none;
        width: 4px;        
    }    
    .scrollable-menu::-webkit-scrollbar-thumb {
        border-radius: 3px;
        background-color: lightgray;
        -webkit-box-shadow: 0 0 1px rgba(255,255,255,.75);        
    }
    

    The changes are reflected here: https://www.bootply.com/BhkCKFEELL

提交回复
热议问题