This post may seem similar to others, but it's not. Please read carefully.
I am looking to make the main container (
<main role="main" class="container">
) full-height between the header and footer using Bootstrap 4. Here is my HTML code:
// Initialize tooltip component
$(function () {
$('[data-toggle="tooltip"]').tooltip()
})
// Initialize popover component
$(function () {
$('[data-toggle="popover"]').popover()
})
.container{
width: 100%;
min-height: 100% !important;
min-height:calc(100% - 110px) !important;
margin: 0 auto -33px;
border: solid blue;
}
<!DOCTYPE html>
<title>My Example</title>
<!-- Latest compiled and minified Bootstrap CSS -->
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin="anonymous">
</head>
<body>
<header>
<nav class="navbar navbar-toggleable-md navbar-inverse bg-inverse fixed-top">
<button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#navbarsExampleDefault" aria-controls="navbarsExampleDefault" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="navbar-brand" href="#" data-placement="right" data-animation="false" data-toggle="tooltip" title="Go to My Summaries">
My Logo</a>
</nav>
</header>
<!-- Begin page content -->
<main role="main" class="container">
<div class="row mt-3" style="border: solid green">
<div class="col-sm-12 col-md-3" style="border: solid red; height: 200%;">col</div>
<div class="col-sm-12 col-md-5">col</div>
<div class="col-sm-12 col-md-4">col</div>
</div>
</main>
<footer>
<nav class="navbar navbar-toggleable-md navbar-inverse fixed-bottom bg-inverse" style="height: 10%;">
</nav>
</footer>
<!-- jQuery library -->
<script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script>
I have searched extensively online and tried various methods suggested in different posts:
- css - Stretch div between header and footer
- css - How to create div to fill all space between header and footer div ...
- html - how to make DIV height 100% between header and footer ...
- html - Content with 100% between header and footer
- css - Make a div fill the height of the remaining screen space - Stack ...
Despite trying many solutions, none of them seem to work for my specific situation.
If anyone has insights or suggestions on how to solve this issue, please share!