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

前端 未结 5 1132
无人及你
无人及你 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:36

    position:fixed works like position:absolute so it isn't positioned in relation of its container. It simply floats into your document. A quick fix would be something like this:

    /* 30% of the document width*/ lorem ipsum dolor sit amet
    /* 30% of the document, leave it empty, so it acts like a placeholder for the fixed element*/  
    /* the rest of the website goes here */ more lorem ipsum than ever before

提交回复
热议问题