Responsive Horizontal Scrolling Menu

后端 未结 4 1903
走了就别回头了
走了就别回头了 2021-01-14 15:50

http://healthunit.com has a clean horizontal scrolling menu at the top of the screen once you view it from a mobile phone device. I\'m trying to mimic that same exact functi

4条回答
  •  礼貌的吻别
    2021-01-14 16:46

    Check out this jsfiddle: http://jsfiddle.net/7vvdB/

    Basically, create an outer container with a max-width of 100% and a overflow-x:scroll, then create an inner container with a fixed width large enough to fit all of your elements, then put all of your elements in the inner container.

    .container_element
    { white-space:nowrap
        min-width:100%;
        overflow-x:scroll;
        overflow-y:hide;
    
    }
    
    .inner_container
    {
        width:5000px;
    }
    }
    

提交回复
热议问题