How to implement fixed sidebar correctly?

后端 未结 3 1769
梦谈多话
梦谈多话 2021-01-30 11:32

I\'m trying to accomplish this design: \"example Where the sidebar will be fixed, but the right side (the main con

3条回答
  •  别那么骄傲
    2021-01-30 11:52

    Here is an alternative: http://jsfiddle.net/BoyWonder/8mVQX/embedded/result/

    body{
        padding-left:200px;
        margin:0;
    }
    div#sidebar{
       position:fixed;
       height:100%;
       width:200px; 
       top:0;
       left:0;
       background:grey; 
    }
    div#content{
        background:black;
        width:100%;
        height:1600px;
    }
    

提交回复
热议问题