I'm trying to vertical align a container div within a jumbotron.
Because the height of the container (and so the jumbotron also) is variable top: 50%; margin-top: -'height * 0.5'
won't work.
@import url('https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css');
.banner {
padding: 48px 0px 48px 0px;
text-align: center;
}
.banner:after {
content: "";
display: block;
padding-top: 12.5%;
}
.container {
background: red !important; /* For testing vertical alignment */
}
<header class="jumbotron banner">
<div class="container">
<h1>Title</h1>
<p>Subtitle</p>
<p> <a class="btn btn-lg btn-primary" href="#" role="button">Button</a>
</p>
</div>
</header>