Skip to content

Instantly share code, notes, and snippets.

@gregoryagu
Last active July 19, 2018 20:40
Show Gist options
  • Save gregoryagu/e05e073c37cea58eaf7723d97dec11f9 to your computer and use it in GitHub Desktop.
Save gregoryagu/e05e073c37cea58eaf7723d97dec11f9 to your computer and use it in GitHub Desktop.
Stretch last item to fill available height using Flex Box
<!doctype html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">
<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="height:350px; background-color:pink;" >
<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" style="flex: 1">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