Looking to design a sleek main page with a footer using bootstrap-4
? Take a look at this example. Despite the footer being styled with bottom: 0;
, it appears in the middle of the screen on browser or mobile view.
HTML:
<div class="row">
<div class="col-xs-12 col-md-6 mt-100">
<h1 class="mb-4">Some Text</h1>
<p style="text-align:justify;" class="lead">
Some text some text Some text some text...
</p>
</div>
<div class="col-xs-12 col-md-6 mt-100">
<div class="text-center">
<p>
Some more Text Some more Text Some more Text...
</p>
</div>
</div>
</div>
<footer class="page-footer">
<p class="text-center">THIS IS THE FOOTER</p>
</footer>
CSS:
html,
body {
min-height: 100%;
height: 100%;
}
.mt-100 {
margin-top: 100px;
}
.page-footer {
background-color: #343a40;
color: white;
padding: 30px;
position: relative;
bottom: 0;
width: 100%;
}