HTML CSS examples for CSS Layout:Flex Container
Scroll on a div instead of the whole page within flexbox
<html> <head></head> <body> <div> <div style="display: flex;flex-direction: row;border: solid 10px"> <div style="margin-right: 50px; background:red"> Sidebar <!--from ww w. ja v a2 s . c om--> </div> <div style="background:blue; overflow:hidden"> <div> Header stays in place </div> <div id="content" style="white-space: nowrap; overflow:auto"> Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> </div> </div> </div> </body> </html>