Skip to content

Instantly share code, notes, and snippets.

@gregoryagu
Last active July 19, 2018 23:51
Show Gist options
  • Save gregoryagu/293fbfbee79eefd3d1351458d8d849c3 to your computer and use it in GitHub Desktop.
Save gregoryagu/293fbfbee79eefd3d1351458d8d849c3 to your computer and use it in GitHub Desktop.
Stretch last item to fill available height using Flex Box with Boostrap 4.1 (not 4 which is missing flex-fill), also using 100vh
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<meta charset="utf-8">
<title>GistRun</title>
<link rel="stylesheet" href="styles.css">
</head>
<body>
<script src="script.js"></script>
<div class="border d-flex flex-column" style="background-color:pink; height:100vh" >
<div class="p-2 border">Item</div>
<div class="p-2 border">Item</div>
<div class="p-2 border">Item</div>
<div class="p-2 border">Item</div>
<div class="p-2 border">Item</div>
<div class="p-2 border flex-fill" >Stretch to fill</div>
</div>
</body>
</html>
console.log('Hello World!');
/* todo: add styles */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment