How to make a fixed column in CSS using CSS Grid Layout?

前端 未结 8 1840
南方客
南方客 2020-12-04 18:35

I\'ve made a simple site with a #container div that is parent to two divs: #left and #right, by using Grid Layout:

Is there an

8条回答
  •  情话喂你
    2020-12-04 18:44

    You can do something like this

    here is the fiddle

    here is the code

    body {
        margin: 0 0 0 0;
    }
    
    #container {
        display: grid;
    
    }
    
    .section {
        padding: 5% 5% 5% 5%;
    }
    
    #left {
        background-color: aquamarine;
        height: 100%;
        position: fixed;
        width: 50%
    }
    
    #right {
        background-color: beige;
        overflow: scroll;
        width: 50%;
        right: 0;
        position: absolute;
    }
    

提交回复
热议问题