HTML CSS examples for CSS Widget:Header
Scroll content under a fixed header while respecting max-height
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style id="compiled-css" type="text/css"> div {<!-- w w w .j av a 2s. c o m--> border: 1px solid #DDD; } .container { max-height: 150px; display: flex; flex-direction:column; } .header { height: 40px; } .scroll { max-height: inherit; overflow: auto; } </style> </head> <body> <div class="container"> <div class="header"> header </div> <div class="scroll"> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> <div> scroll </div> </div> </div> </body> </html>