Created
July 16, 2018 14:20
-
-
Save Linux249/13581ca0cfc46011d9d2547a58ae6fa4 to your computer and use it in GitHub Desktop.
scrollable middle container
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>Test fixed and scrolling divs in a flexbox layout</title> | |
<style> | |
* { | |
border: 0; | |
margin: 0; | |
padding: 0; | |
} | |
html { | |
height: 100%; | |
} | |
body { | |
background-color: green; | |
height: inherit; | |
} | |
div.container { | |
flex: auto; | |
display: flex; | |
flex-direction: column; | |
max-height: 100%; | |
} | |
div.fixed { | |
flex: none; | |
height: 36px; | |
} | |
div.scrolling { | |
flex: auto; | |
overflow-y: auto; | |
background-color: purple; | |
} | |
div.left { | |
width: 5rem; | |
background-color: #333333; | |
} | |
div.body { | |
display: flex; | |
} | |
</style> | |
</head> | |
<body> | |
<div class="container"> | |
<div class="fixed"> | |
Fixed top section | |
</div> | |
<div class="body"> | |
<div class="scrolling"> | |
<p> | |
Scrolling middle | |
</p> | |
<p> | |
Scrolling middle | |
</p> | |
<p> | |
Scrolling middle | |
</p> | |
<p> | |
Scrolling middle | |
</p> | |
<p> | |
Scrolling middle | |
</p> | |
<p> | |
Scrolling middle | |
</p> | |
<p> | |
Scrolling middle | |
</p> | |
</div> | |
<div class="left">te</div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment