Is it possible to scroll a div content between another 2 flex divs?

前端 未结 2 1120
栀梦
栀梦 2021-01-24 06:33

I have a header bar(#A) sticked on top and a footer bar(#C) sticked on the bottom of the page. Each one have a fixed height of 30px and are represented here by the

2条回答
  •  无人及你
    2021-01-24 06:51

    Maybe you are trying to achieve something like this:

    html   { height: 100%; min-height: 100%; }
    body   { height: 100%; min-height: 100%; margin: 0; }
    
    #container { 
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    #A { flex: 0 0 30px; }
    
    #B { flex: 1 1 auto; overflow: auto; }
    
    #C { flex: 0 0 30px; }
    

    http://codepen.io/simoncereska/pen/xZQPXQ

提交回复
热议问题