A `position:fixed` sidebar whose width is set in percentage?

前端 未结 5 1119
无人及你
无人及你 2021-01-02 09:01

I\'ve successfully used the beautiful Susy grid system to create a responsive layout similiar to the one of WebDesignerWall.com:

What i failed to implement is a

5条回答
  •  [愿得一人]
    2021-01-02 09:40

    Why don't you just use math? =)

    Example html:

     
    This is fixed

    CSS

    .container {
        width: 80%;
        margin: 0 auto;
    }
    
    .col {
       float: left;
        width: 33.3333333333%;
    }
    
    .fixed {
        position: fixed;
        width: 26.666666666%; /* .container width x .col width*/
    }
    

提交回复
热议问题