I am trying to create a page layout where most of the page is static and only the contents of a single div scroll. For simplicity, I am starting with two divs "header" and "content", but I don't want to use position:fixed on the header because I want to be able to expand this to have any number of other elements on the page. How do I achieve this?
Below is the code that I have so far (I am using React). Right now, none of it scrolls at all.
Thanks!
The react element:
var Scrolly = React.createClass({ render: function(){ var lorem = "Lorem ipsum dolor sit amet... "; var sampleText = lorem + lorem + lorem + lorem; var sampleHeader = "this is a header!" return( <div className={"scrolly"}> <div className={"header"}> {sampleHeader} </div> <div className={"content"}> {sampleText} </div> </div> ); } }); The less file:
.scrolly{ .content{ overflow: auto; max-height: 100%; } }