Search code examples
cssoffsetfixed

Hidden content when position fixed and top>0


Here is my example if you try to scroll down you will only get some content, and you can't view the last lines. How I might fix this?

div#scrollable {
    overflow-y: scroll;
    height: 100%;
    position: fixed;
    top: 100px;
}

I need:

  • Fixed div;
  • Offset of some value from the top;

Thanks


Solution

  • Try the following:

    div#scrollable {
        overflow-y: scroll;
        position: fixed;
        top: 100px;
        bottom: 0;
        width: 100%;
    }
    

    See demo: http://jsfiddle.net/audetwebdesign/a8dxhLra/